Namensräume
Varianten
Aktionen

std::bitset::to_ulong

Aus cppreference.com
< cpp‎ | utility‎ | bitset

 
 
 
std::bitset
Mitglied Typen
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::reference
Member-Funktionen
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::bitset
bitset::operator==
bitset::operator!=
Elementzugriff zerstört
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator[]
bitset::test
bitset::all
bitset::any
bitset::none
(C++11)

 
bitset::count
Kapazität
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::size
Modifiers
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator&=
bitset::operator|=
bitset::operator^=
bitset::operator~
bitset::operator<<=
bitset::operator>>=
bitset::operator<<
bitset::operator>>
bitset::set
bitset::reset
bitset::flip
Conversions
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::to_string
bitset::to_ulong
bitset::to_ullong(C++11)
Non-Member-Funktionen
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator&
operator|
operator^
operator<<
operator>>
Helper-Klassen
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::hash(C++11)
 
unsigned long to_ulong() const
Konvertiert den Inhalt der bitset einer unsigned long integer .
Original:
Converts the contents of the bitset to an unsigned long integer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Das erste Bit des bitset entspricht dem niederwertigsten Ziffer der Zahl und das letzte Bit entspricht der höchstwertigen Stelle .
Original:
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.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Parameter

(None)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

die konvertierte Ganzzahl
Original:
the converted integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Ausnahmen

wirft std::overflow_error, wenn der Wert nicht in unsigned long vertreten sein .
Original:
throws std::overflow_error if the value can not be represented in unsigned long.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

#include <iostream>
#include <bitset>
 
int main()
{
    for (unsigned long i = 0; i < 10; ++i) {
        std::bitset<5> b(i);
        std::bitset<5> b_inverted = ~b;
        std::cout << i << '\t';
        std::cout << b << '\t';
        std::cout << b_inverted << '\t';
        std::cout << b_inverted.to_ulong() << '\n'; 
    }
}

Output:

0	00000	11111	31
1	00001	11110	30
2	00010	11101	29
3	00011	11100	28
4	00100	11011	27
5	00101	11010	26
6	00110	11001	25
7	00111	11000	24
8	01000	10111	23
9	01001	10110	22

[Bearbeiten] Siehe auch

liefert eine String-Repräsentation der Daten
Original:
returns a string representation of the data
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion) [edit]
(C++11)
gibt eine unsigned long long Integerdarstellung der Daten
Original:
returns an unsigned long long integer representation of the data
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion) [edit]