11 pset.
put<
int>(
"a", -1);
12 assert(pset.
get<
int>(
"a") == -1);
14 pset.
get<
unsigned int>(
"a", 0u);
24 pset.
put<
double>(
"c", 2.3);
25 assert(pset.
get<
double>(
"c") == 2.3);
27 pset.
put<
bool>(
"d",
true);
28 assert(pset.
get<
bool>(
"d") ==
true);
34 pset.
put<std::vector<int>>(
"e", vi);
35 assert(pset.
get<std::vector<int>>(
"e")[1] == -2);
38 std::vector<unsigned int> vui_def;
39 pset.
get<std::vector<unsigned int>>(
"e", vui_def);
46 std::vector<double> vd;
50 pset.
put<std::vector<double>>(
"f", vd);
51 assert(pset.
get<std::vector<double>>(
"f")[1] == 0.2);
53 std::vector<std::string> vs;
57 pset.
put<std::vector<std::string>>(
"g", vs);
60 pset2.put<
int>(
"a2", 1);
65 assert(pset2.to_string() ==
"a2:1 b2:\"bstring\"");
67 pset.
put<
unsigned int>(
"u1", 12);
68 assert(pset.
get<
unsigned int>(
"u1") == 12);
70 pset.
put<
unsigned int>(
"u2", 0);
71 assert(pset.
get<
unsigned int>(
"u2") == 0);
73 std::vector<unsigned int> vui;
77 pset.
put<std::vector<unsigned int>>(
"vu", vui);
78 assert(pset.
get<std::vector<int>>(
"vu")[1] == 2);
79 assert(pset.
get<std::vector<unsigned int>>(
"vu")[1] == 2);
82 assert(pset.
get<
int>(
"int_str") == 12);
85 assert(pset.
get<
double>(
"float_str") == 3e2);
88 assert(pset.
get<
double>(
"float_str2") == 3.2);
90 pset.
put<
bool>(
"b1",
true);
91 assert(pset.
get<
bool>(
"b1") ==
true);
93 pset.
put<
bool>(
"b2",
false);
94 assert(pset.
get<
bool>(
"b2") ==
false);
97 assert(!names.empty());
98 assert(names[0].
compare(
"h") == 0);
101 assert(pset.
get<
bool>(
"b3") ==
true);
103 assert(pset.
get<
bool>(
"b4") ==
false);
int compare(unsigned *r, sha1::digest_t const &d)
std::vector< std::string > get_pset_names() const
T get(std::string const &key) const
static std::vector< std::string > const names
void put(std::string const &key)
cet::coded_exception< error, detail::translate > exception