aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-15 15:17:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-15 15:17:14 +0200
commitfde4431ec608b467de6ab205e3f73848fe9efbdf (patch)
tree49e9729d14a73c5d20155e55ac67c7241499749d
parentcbf4330065371f286bdd82d63d108a4104b09c4c (diff)
Rename variable in generated code to avoid conflict
This allows "unofficial" (as in, it compiles but hasn't been reviewed or tested) use of object pointers as object ids.
-rw-r--r--odb/relational/source.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index f679366..f7ae8f3 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -2259,7 +2259,7 @@ namespace relational
os << "bool is_null (ptr_traits::null_ptr (" << member << "));"
<< "if (!is_null)"
<< "{"
- << "const " << type << "& id (" << endl;
+ << "const " << type << "& ptr_id (" << endl;
if (lazy_pointer (pt))
os << "ptr_traits::object_id< ptr_traits::element_type > (" <<
@@ -2270,7 +2270,7 @@ namespace relational
os << ");"
<< endl;
- member = "id";
+ member = "ptr_id";
}
else if (comp != 0)
type = mi.fq_type ();
@@ -2721,9 +2721,9 @@ namespace relational
os << "else"
<< "{";
- os << type << " id;";
+ os << type << " ptr_id;";
- member = "id";
+ member = "ptr_id";
}
else
type = mi.fq_type ();
@@ -2765,7 +2765,7 @@ namespace relational
if (lazy_pointer (pt))
os << member << " = ptr_traits::pointer_type (" << endl
- << "*static_cast<" << db << "::database*> (db), id);";
+ << "*static_cast<" << db << "::database*> (db), ptr_id);";
else
{
os << "// If a compiler error points to the line below, then" << endl
@@ -2774,7 +2774,7 @@ namespace relational
<< "//" << endl
<< member << " = ptr_traits::pointer_type (" << endl
<< "static_cast<" << db << "::database*> (db)->load<" << endl
- << " obj_traits::object_type > (id));";
+ << " obj_traits::object_type > (ptr_id));";
// If we are loading into an eager weak pointer, make sure there
// is someone else holding a strong pointer to it (normally a