std::bitset<N>::to_ullong (3) - Linux Manuals
std::bitset<N>::to_ullong: std::bitset<N>::to_ullong
Command to display std::bitset<N>::to_ullong
manual in Linux: $ man 3 std::bitset<N>::to_ullong
NAME
std::bitset<N>::to_ullong - std::bitset<N>::to_ullong
Synopsis
unsigned long long to_ullong() const (since C++11)
Converts the contents of the bitset to an unsigned long long integer.
The first bit of the bitset corresponds to the least significant digit of the number and the last bit corresponds to the most significant digit.
Parameters
(none)
Return value
the converted integer
Exceptions
std::overflow_error if the value can not be represented in unsigned long long.
Example
// Run this code
#include <iostream>
#include <bitset>
#include <limits>
int main()
{
std::bitset<std::numeric_limits<unsigned long long>::digits> b(
0x123456789abcdef0LL
);
std::cout << b << " " << std::hex << b.to_ullong() << '\n';
b.flip();
std::cout << b << " " << b.to_ullong() << '\n';
}
Output:
0001001000110100010101100111100010011010101111001101111011110000 123456789abcdef0
1110110111001011101010011000011101100101010000110010000100001111 edcba9876543210f
See also
returns a string representation of the data
to_string (public member function)
returns an unsigned long integer representation of the data
to_ulong (public member function)
Pages related to std::bitset<N>::to_ullong
- std::bitset<N>::to_ulong (3) - std::bitset<N>::to_ulong
- std::bitset<N>::to_string (3) - std::bitset<N>::to_string
- std::bitset<N>::test (3) - std::bitset<N>::test
- std::bitset<N>::all,std::bitset<N>::any,std::bitset<N>::none (3) - std::bitset<N>::all,std::bitset<N>::any,std::bitset<N>::none
- std::bitset<N>::bitset (3) - std::bitset<N>::bitset
- std::bitset<N>::count (3) - std::bitset<N>::count
- std::bitset<N>::flip (3) - std::bitset<N>::flip
- std::bitset<N>::operator&=,|=,^=,~ (3) - std::bitset<N>::operator&=,|=,^=,~
- std::bitset<N>::operator<<,<<=,>>,>>= (3) - std::bitset<N>::operator<<,<<=,>>,>>=
- std::bitset<N>::operator[] (3) - std::bitset<N>::operator[]
- std::bitset<N>::reference (3) - std::bitset<N>::reference
- std::bitset<N>::reset (3) - std::bitset<N>::reset
- std::bitset<N>::set (3) - std::bitset<N>::set
- std::bitset<N>::size (3) - std::bitset<N>::size
- std::bitset (3) - std::bitset