aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-10-29 10:02:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-10-29 10:02:16 +0200
commit938d136b09b868f633574c722d48c2953dde1be4 (patch)
tree9e5f9c2d8d271b3000eeae3856808c466a9f6438 /odb/relational/source.hxx
parent97810bec4dfae25f20899446e75821e5d799834f (diff)
Cast odb::database to concrete type when initializing object pointer
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index a284676..8d57b1b 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -1666,7 +1666,8 @@ namespace relational
semantics::type& pt (member_utype (mi.m, key_prefix_));
if (lazy_pointer (pt))
- os << member << " = ptr_traits::pointer_type (*db, id);";
+ os << member << " = ptr_traits::pointer_type (" << endl
+ << "*static_cast<" << db << "::database*> (db), id);";
else
{
os << "// If a compiler error points to the line below, then" << endl
@@ -1674,7 +1675,8 @@ namespace relational
<< "// cannot be initialized from an object pointer." << endl
<< "//" << endl
<< member << " = ptr_traits::pointer_type (" << endl
- << "db->load< obj_traits::object_type > (id));";
+ << "static_cast<" << db << "::database*> (db)->load<" << endl
+ << " obj_traits::object_type > (id));";
// If we are loading into an eager weak pointer, make sure there
// is someone else holding a strong pointer to it (normally a