21 int_to_str_table.clear();
22 str_to_str_table.clear();
24 int_to_str_table.insert_or_assign(100,
"hundred");
25 str_to_str_table.insert_or_assign(
"a",
"b");
27# if __cplusplus >= 201703L
28 auto val1 = int_to_str_table.find(100);
29 auto val2 = str_to_str_table.find(
"a");
31 std::cout <<
"kv_table1[100]: " << *val1 << std::endl;
33 std::cout <<
"kv_table1[100]: not found" << std::endl;
36 std::cout <<
"kv_table2[\"a\"]: " << *val2 << std::endl;
38 std::cout <<
"kv_table2[\"a\"]: not found" << std::endl;
40 auto val1 = int_to_str_table.find_compat(100);
41 auto val2 = str_to_str_table.find_compat(
"a");
43 std::cout <<
"kv_table1[100]: " << val1.second << std::endl;
45 std::cout <<
"kv_table1[100]: not found" << std::endl;
48 std::cout <<
"kv_table2[\"a\"]: " << val2.second << std::endl;
50 std::cout <<
"kv_table2[\"a\"]: not found" << std::endl;
53 std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
Declaration of the KeyValueTable class for managing key-value pairs in an MDBX database.
int main()
Entry point demonstrating AnyValueTable.
Parameters used by Connection to create the MDBX environment.
std::string pathname
Path to the database file or directory containing the database.
int64_t max_dbs
Maximum number of named databases (DBI) in the environment.
static std::shared_ptr< Connection > create(const Config &config)
Creates and connects a new shared Connection instance.
Template class for managing key-value pairs in an MDBX database.