public
Created

  • Download Gist
stl-ex-1c.cpp
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14
int vector_test(int, char**)
{
typedef dbstl::db_vector <double, ElementHolder<double> > dbl_vec_t;
DbEnv *penv = new DbEnv(DB_CXX_NO_EXCEPTIONS); // (2)
penv->open("dbenv",
flags | DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE, 0777); // (3)
pdb = dbstl::open_db(penv, "vector2.db",
DB_RECNO, DB_CREATE | dboflags, 0); // (4)
dbstl::register_db_env(penv); // (5)
dbstl::register_db(pdb); // (6)
dbl_vec_t v1(penv, pdb); // (7)
v1.push_back(32.1);
v1.push_back(40.5);
// The rest follows ...

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.