[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/utility/bitset/all_any_none [Back]  [Original]

std::bitset<N>::all, std::bitset<N>::any, std::bitset<N>::none cppreference.com
cppreference.com

std::bitset<N>::all, std::bitset<N>::any, std::bitset<N>::none

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
 
 
<tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody>
(1)
bool all() const;
( C++11)
bool all() const noexcept;
( C++11)
(constexpr C++23)
(2)
bool any() const;
( C++11)
bool any() const noexcept;
( C++11)
(constexpr C++23)
(3)
bool none() const;
( C++11)
bool none() const noexcept;
( C++11)
(constexpr C++23)
1) , true
2) , - true
3) , true

()

1) true, true, false
2) true, true, false
3) true, true, false

#include <bitset>
#include <iostream>

int main()
{
    std::bitset<4> b1("0000");
    std::bitset<4> b2("0101");
    std::bitset<4> b3("1111");

    std::cout << "bitset\t" << "all\t" << "any\t" << "none\n";
    std::cout << b1 << '\t' << b1.all() << '\t' << b1.any() << '\t' << b1.none() << '\n';
    std::cout << b2 << '\t' << b2.all() << '\t' << b2.any() << '\t' << b2.none() << '\n';
    std::cout << b3 << '\t' << b3.all() << '\t' << b3.any() << '\t' << b3.none() << '\n';
}

:

bitset  all     any     none
0000    0       0       1
0101    0       1       0
1111    1       1       0

C++:

LWG 693 C++98 - all()

, true
(public -) []
(C++20)

( ) []

Web Proxy Viewer  |  New URL  |  Original Page