list of "canonical" typedefs?

Daniel Krügler daniel.kruegler@gmail.com
Mon Aug 27 18:18:00 GMT 2012


2012/8/27 Tom Tromey <tromey@redhat.com>:
> A while ago Benjamin pointed out that ptype (in gdb) can result in
> crazily voluminous output for "simple" types.  For example I've appended
> the output of ptype for a variable whose type is
> std::unordered_set<std::string>.
>
> I've been working on a gdb patch to fix this.  I made a lot of progress
> just by considering template arguments and typedefs local to the class.
>
> However, I think gdb could go a bit beyond this and let libraries
> specify "type name substitutions" -- a kind of simple pretty-printing
> for types.
>
> I have all this working, too, but I find I don't actually know what
> typedefs libstdc++ provides that you would consider canonical -- that
> is, names which should be printed to users by default.
>
> My current list is:
>
>     for name in ('std::istream', 'std::ostream', 'std::iostream',
>                  'std::string', 'std::wstring'):
>
> What other ones are there?

In addition to Jonathan's list:

std::u16string // C++11
std::u32string // C++11

I would also find the following of interest (C++11):

typedef duration<signed integer type of at least 64 bits , nano> nanoseconds;
typedef duration<signed integer type of at least 55 bits , micro> microseconds;
typedef duration<signed integer type of at least 45 bits , milli> milliseconds;
typedef duration<signed integer type of at least 35 bits > seconds;
typedef duration<signed integer type of at least 29 bits , ratio< 60>> minutes;
typedef duration<signed integer type of at least 23 bits , ratio<3600>> hours;

and from <random>

typedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
minstd_rand0;

typedef linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
minstd_rand;

typedef mersenne_twister_engine<uint_fast32_t,
32,624,397,31,0x9908b0df,11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253>
mt19937;

typedef mersenne_twister_engine<uint_fast64_t,
64,312,156,31,0xb5026f5aa96619e9,29,
0x5555555555555555,17,
0x71d67fffeda60000,37,
0xfff7eee000000000,43,
6364136223846793005>
mt19937_64;

typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
ranlux24_base;

typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
ranlux48_base;

typedef discard_block_engine<ranlux24_base, 223, 23>
ranlux24;

typedef discard_block_engine<ranlux48_base, 389, 11>
ranlux48;

typedef shuffle_order_engine<minstd_rand0,256>
knuth_b;

typedef implementation-defined
default_random_engine;

- Daniel



More information about the Libstdc++ mailing list