Return a string representation of this bitset using zero and one.
Synopsis
Declared in <bslstl_bitset.h>
template<
class CHAR_TYPE = char,
class TRAITS = char_traits<CHAR_TYPE>,
class ALLOCATOR = allocator<CHAR_TYPE>>
basic_string<CHAR_TYPE, TRAITS, ALLOCATOR>
to_string(
CHAR_TYPE zero = CHAR_TYPE('0'),
CHAR_TYPE one = CHAR_TYPE('1')) const;
Description
Return a basic_string representation of this bitset, where the zero‐bits are represented by the specified zero character and the one‐bits are represented by the specified one character. The most‐significant bit is placed at the beginning of the string, and the least‐significant bit is placed at the end of the string.
Return Value
string representation of this bitset
Parameters
Name |
Description |
zero |
character representing an unset bit (default '0') |
one |
character representing a set bit (default '1') |
Created with MrDocs