首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::vector<bool>::reference

class reference;

std::vector<bool>专业化定义std::vector<bool>::reference作为一个可公开访问的嵌套类。std::vector<bool>::reference中对单个位的引用的行为。std::vector<bool>...

主要用途std::vector<bool>::reference提供一个可以从operator[]...

任何通过std::vector<bool>::reference潜在地读取或写入整个基础向量。

成员函数

(constructor)

constructs the reference. Accessible only to std::vector<bool> itself (public member function)

(destructor)

destroys the reference (public member function)

operator=

assigns a bool to the referenced bit (public member function)

operator bool

returns the referenced bit (public member function)

flip

flips the referenced bit (public member function)

STD::向量<bool>*~参考

~reference()

摧毁了引用。

STD::向量<bool>*参考::操作员=

reference& operator=( bool x ); reference& operator=( const reference& x );

为引用的位分配一个值。

参数

x

-

value to assign

返回值

*this...

例外

(none)

(until C++11)

noexcept specification: noexcept

(since C++11)

STD::向量<bool>*参考资料::操作人员bool

operator bool() const;

返回引用位的值。

参数

%280%29

返回值

参考位。

例外

(none)

(until C++11)

noexcept specification: noexcept

(since C++11)

STD::向量<bool>*参考资料::翻转

void flip();

反转所引用的位。

参数

%280%29

返回值

%280%29

例外

(none)

(until C++11)

noexcept specification: noexcept

(since C++11)

另见

operator[]

access specified element (public member function of std::vector)

swap static

swaps two std::vector<bool>::references (public static member function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券