关于boolalpha,我知道它可以将布尔类型以true或者false输出。
例如 :
bool x = ture;
cout << boolalpha << x << endl;
那么会输出true;
然而在xcode输出时会联想到这个函数
boolalpha(<#std::ios_base &__str#>)
这个是什么意思呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
std::boolalpha本身是函数,去调用ios_base::setfstream重载operator<< (std::ios_base& (*func)(std::ios_base&)).如果不做成函数就需要这样写,因为setf返回的是
fmtflags,不是stream