GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::bitset::to_ullong(3) C++ Standard Libary std::bitset::to_ullong(3)

std::bitset::to_ullong - std::bitset::to_ullong


unsigned long long to_ullong() const (since C++11)
(until C++23)
constexpr unsigned long long to_ullong() const (since C++23)


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.


(none)


the converted integer


std::overflow_error if the value can not be represented in unsigned long long.

// 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';
}


0001001000110100010101100111100010011010101111001101111011110000 123456789abcdef0
1110110111001011101010011000011101100101010000110010000100001111 edcba9876543210f


to_string returns a string representation of the data
(public member function)
to_ulong returns an unsigned long integer representation of the data
(public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.