c++ - 不同流状态的定义(C++)

标签 c++ class iostream definition template-classes

我知道 ios_base 有一个流状态声明,例如
ios_base::goodbit(错误状态)
ios_base::ate(文件打开模式状态)
还有更多。
我感兴趣的是 ios_base
这些成员函数的定义 它们是简单的还是类模板?它们是如何实现的?哪一个有父类(如果有的话)?

最佳答案

Are they a simple class or a class template?

它们实际上是嵌套在 std::ios_base 中的 static constexpr 声明类(来自 the reference documentation ):

enter image description here

How are they implemented? Which one is there parent class(if any)?

正如那里提到的,它是特定于编译器实现的。通常这些是没有使用父类的简单值。

关于c++ - 不同流状态的定义(C++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27988870/

相关文章:

c# - 在 C++ 中使用回调函数 C# 委托(delegate) dll

c++ - 在函数中使用非静态值作为默认参数

c++ - 将 std::cout 重定向到 QTextEdit

c++ - endl 是什么类型的函数?我如何定义类似 endl 的东西?

c++ - 如何获取 GDI 句柄列表

c++ - C++11 condition_variables 可以用于同步进程吗?

c++ - 为什么(仅)某些编译器对相同的字符串文字使用相同的地址?

c++ - 如何解释我在源代码中找到的这个 C++ 类声明?

c++ - 在C++中访问类字段

c++ - 从 std::vector<unsigned char> 读取二进制数据的最简单方法?