intmain(){ rocksdb::DB* db; rocksdb::Options options; options.create_if_missing = true; rocksdb::Status status = rocksdb::DB::Open(options, "./db_dir", &db); status = db->Put(rocksdb::WriteOptions(), "hello", "world"); //写 if (status.ok()) { std::string k("hello"); std::string v; db->Get(rocksdb::ReadOptions(), k, &v); //读 std::cout << v << std::endl; } assert(status.ok()); }
编译 & 链接
尝试:
1
g++ test.cc
报错:
1 2 3 4
/usr/local/include/rocksdb/wide_columns.h:51:21: error: ‘make_from_tuple’ is not a member of ‘std’; did you mean ‘make_tuple’? 51 | value_(std::make_from_tuple<Slice>(std::forward<VTuple>(value_tuple))) { | ^~~~~~~~~~~~~~~ | make_tuple