C++ 教程

C++ 教程 C++ 简介 C++ 入门 C++ 语法 C++ 输出 C++ 注释 C++ 变量 C++ 用户输入 C++ 数据类型 C++ 运算符 C++ 字符串 C++ 数学运算 C++ 布尔值 C++ 条件语句 C++ Switch 语句 C++ While 循环 C++ For 循环 C++ Break/Continue 语句 C++ 数组 C++ 引用 C++ 指针

C++ 函数

C++ 函数 C++ 函数参数 C++ 函数重载

C++ 面向对象

C++ OOP C++ 类和对象 C++ 类方法 C++ 构造函数 C++ 访问修饰符 C++ 封装 C++ 继承 C++ 多态

C++ 高级教程

C++ 文件 C++ 异常处理 C++ 动态内存 C++ 命名空间 C++ 模板 C++ 预处理器 C++ 信号处理 C++ 多线程 C++ Web 编程 C++ 正则表达式

C++ 如何使用

C++ 两个数字相加

C++ 标准库参考

C++ 标准库 - 简介 C++ 标准库 - <fstream> C++ 标准库 - <iomanip> C++ 标准库 - <ios> C++ 标准库 - <iosfwd> C++ 标准库 - <iostream> C++ 标准库 - <istream> C++ 标准库 - <ostream> C++ 标准库 - <sstream> C++ 标准库 - <streambuf> C++ 标准库 - <atomic> C++ 标准库 - <complex> C++ 标准库 - <exception> C++ 标准库 - <functional> C++ 标准库 - <limits> C++ 标准库 - <locale> C++ 标准库 - <memory> C++ 标准库 - <new> C++ 标准库 - <numeric> C++ 标准库 - <regex> C++ 标准库 - <stdexcept> C++ 标准库 - <string> C++ 标准库 - <thread> C++ 标准库 - <tuple> C++ 标准库 - <typeinfo> C++ 标准库 - <utility> C++ 标准库 - <valarray>

C++ 模板库参考

C++ STL 库 - <array> C++ STL 库 - <bitset> C++ STL 库 - <deque> C++ STL 库 - <forward_list> C++ STL 库 - <list> C++ STL 库 - <map> C++ STL 库 - <queue> C++ STL 库 - <set> C++ STL 库 - <stack> C++ STL 库 - <unordered_map> C++ STL 库 - <unordered_set> C++ STL 库 - <vector> C++ STL 库 - <algorithm> C++ STL 库 - <iterator>

C++ 实例

C++ 实例 C++ 练习 C++ 测验



C++ 标准库 - <iosfwd>

描述

用于输入-输出前向声明,该头文件为标准输入/输出库的类型提供前向声明。


定义

以下是 iosfwd 函数的定义。

 #define _GLIBCXX_IOSFWD

示例

C++98

在下面的示例中解释了 iosfwd 功能。

amespace std {
   template<class charT> struct char_traits;
   template<> class char_traits<char>;
   template<> class char_traits<wchar_t>;

   template<class T> class allocator;

   template <class charT, class traits=char_traits<charT> > class basic_ios;
   template <class charT, class traits=char_traits<charT> > class basic_streambuf;
   template <class charT, class traits=char_traits<charT> > class basic_istream;
   template <class charT, class traits=char_traits<charT> > class basic_ostream;
   template <class charT, class traits=char_traits<charT> > class basic_iostream;
 
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_stringbuf;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> > 
      class basic_istringstream;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_ostringstream;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_stringstream;

   template <class charT, class traits=char_traits<charT> > class basic_filebuf;
   template <class charT, class traits=char_traits<charT> > class basic_ifstream;
   template <class charT, class traits=char_traits<charT> > class basic_ofstream;
   template <class charT, class traits=char_traits<charT> > class basic_fstream;

   template <class charT, class traits=char_traits<charT> > class istreambuf_iterator;
   template <class charT, class traits=char_traits<charT> > class ostreambuf_iterator;

   template<class stateT> class fpos;

   typedef basic_ios<char>              ios;
   typedef basic_streambuf<char>        streambuf;
   typedef basic_istream<char>          istream;
   typedef basic_ostream<char>          ostream;
   typedef basic_iostream<char>         iostream;
   typedef basic_stringbuf<char>        stringbuf;
   typedef basic_istringstream<char>    istringstream;
   typedef basic_ostringstream<char>    ostringstream;
   typedef basic_stringstream<char>     stringstream;
   typedef basic_filebuf<char>          filebuf;
   typedef basic_ifstream<char>         ifstream;
   typedef basic_ofstream<char>         ofstream;
   typedef basic_fstream<char>          fstream;

   typedef basic_ios<wchar_t>           wios;
   typedef basic_streambuf<wchar_t>     wstreambuf;
   typedef basic_istream<wchar_t>       wistream;
   typedef basic_ostream<wchar_t>       wostream;
   typedef basic_iostream<wchar_t>      wiostream;
   typedef basic_stringbuf<wchar_t>     wstringbuf;
   typedef basic_istringstream<wchar_t> wistringstream;
   typedef basic_ostringstream<wchar_t> wostringstream;
   typedef basic_stringstream<wchar_t>  wstringstream;
   typedef basic_filebuf<wchar_t>       wfilebuf;
   typedef basic_ifstream<wchar_t>      wifstream;
   typedef basic_ofstream<wchar_t>      wofstream;
   typedef basic_fstream<wchar_t>       wfstream;

   typedef fpos<mbstate_t> streampos;
   typedef fpos<mbstate_t> wstreampos;
}

C++11

在下面的示例中解释了 iosfwd 功能。

namespace std {
   template<class charT> struct char_traits;
   template<> class char_traits<char>;
   template<> class char_traits<char16_t>;
   template<> class char_traits<char32_t>;
   template<> class char_traits<wchar_t>;

   template<class T> class allocator;

   template <class charT, class traits=char_traits<charT> > class basic_ios;
   template <class charT, class traits=char_traits<charT> > class basic_streambuf;
   template <class charT, class traits=char_traits<charT> > class basic_istream;
   template <class charT, class traits=char_traits<charT> > class basic_ostream;
   template <class charT, class traits=char_traits<charT> > class basic_iostream;
 
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_stringbuf;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> > 
      class basic_istringstream;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_ostringstream;
   template <class charT, class traits=char_traits<charT>, class Alloc=allocator<charT> >
      class basic_stringstream;

   template <class charT, class traits=char_traits<charT> > class basic_filebuf;
   template <class charT, class traits=char_traits<charT> > class basic_ifstream;
   template <class charT, class traits=char_traits<charT> > class basic_ofstream;
   template <class charT, class traits=char_traits<charT> > class basic_fstream;

   template <class charT, class traits=char_traits<charT> > class istreambuf_iterator;
   template <class charT, class traits=char_traits<charT> > class ostreambuf_iterator;

  template<class stateT> class fpos;

   typedef basic_ios<char>              ios;
   typedef basic_streambuf<char>        streambuf;
   typedef basic_istream<char>          istream;
   typedef basic_ostream<char>          ostream;
   typedef basic_iostream<char>         iostream;
   typedef basic_stringbuf<char>        stringbuf;
   typedef basic_istringstream<char>    istringstream;
   typedef basic_ostringstream<char>    ostringstream;
   typedef basic_stringstream<char>     stringstream;
   typedef basic_filebuf<char>          filebuf;
   typedef basic_ifstream<char>         ifstream;
   typedef basic_ofstream<char>         ofstream;
   typedef basic_fstream<char>          fstream;

   typedef basic_ios<wchar_t>           wios;
   typedef basic_streambuf<wchar_t>     wstreambuf;
   typedef basic_istream<wchar_t>       wistream;
   typedef basic_ostream<wchar_t>       wostream;
   typedef basic_iostream<wchar_t>      wiostream;
   typedef basic_stringbuf<wchar_t>     wstringbuf;
   typedef basic_istringstream<wchar_t> wistringstream;
   typedef basic_ostringstream<wchar_t> wostringstream;
   typedef basic_stringstream<wchar_t>  wstringstream;
   typedef basic_filebuf<wchar_t>       wfilebuf;
   typedef basic_ifstream<wchar_t>      wifstream;
   typedef basic_ofstream<wchar_t>      wofstream;
   typedef basic_fstream<wchar_t>       wfstream;

   typedef fpos<mbstate_t> streampos;
   typedef fpos<mbstate_t> wstreampos;
}