aboutsummaryrefslogtreecommitdiff
path: root/common/session/custom/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-11 13:07:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-11 13:07:36 +0200
commitf05b0f063942a65f7a9c04609b9e5b7aa3b6a89c (patch)
tree80db32f7fd1642a8da56fa5b8d387b7392419a66 /common/session/custom/driver.cxx
parent72d6556cc3b71517f55bd5938d4f272de794892b (diff)
Account for C++11 compilers without default function template arguments
Diffstat (limited to 'common/session/custom/driver.cxx')
-rw-r--r--common/session/custom/driver.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx
index 2baa122..ab111b2 100644
--- a/common/session/custom/driver.cxx
+++ b/common/session/custom/driver.cxx
@@ -14,6 +14,7 @@
#include <odb/database.hxx>
#include <odb/session.hxx>
#include <odb/transaction.hxx>
+#include <odb/details/config.hxx> // ODB_CXX11_*
#include <common/common.hxx>
@@ -88,7 +89,11 @@ main (int argc, char* argv[])
transaction t (db->begin ());
st = db->load<employer> ("Simple Tech Ltd");
+#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
ste = db->load<employee> (st->employees ()[0].object_id ());
+#else
+ ste = db->load<employee> (st->employees ()[0].object_id<employee> ());
+#endif
// Test object cache.
//
@@ -103,7 +108,11 @@ main (int argc, char* argv[])
transaction t (db->begin ());
cs = db->load<employer> ("Complex Systems Inc");
+#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
cse = db->load<employee> (cs->employees ()[0].object_id ());
+#else
+ cse = db->load<employee> (cs->employees ()[0].object_id<employee> ());
+#endif
cs->employees ()[0].load ();
t.commit ();