aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/processor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/processor.cxx')
-rw-r--r--odb/relational/processor.cxx32
1 files changed, 29 insertions, 3 deletions
diff --git a/odb/relational/processor.cxx b/odb/relational/processor.cxx
index 68e8ab6..f000858 100644
--- a/odb/relational/processor.cxx
+++ b/odb/relational/processor.cxx
@@ -1609,7 +1609,6 @@ namespace relational
os << f << ":" << l << ":" << c << ": error: "
<< "wrapper_traits specialization does not define the "
<< "wrapped_type type" << endl;
-
throw;
}
@@ -1659,7 +1658,6 @@ namespace relational
os << f << ":" << l << ":" << c << ": error: "
<< "wrapper_traits specialization does not define the "
<< "null_handler constant" << endl;
-
throw;
}
@@ -1708,11 +1706,39 @@ namespace relational
os << f << ":" << l << ":" << c << ": error: "
<< "wrapper_traits specialization does not define the "
<< "null_default constant" << endl;
-
throw;
}
}
+ // Check if the wrapper is a TR1 template instantiation.
+ //
+ if (tree ti = TYPE_TEMPLATE_INFO (t.tree_node ()))
+ {
+ tree decl (TI_TEMPLATE (ti)); // DECL_TEMPLATE
+
+ // Get to the most general template declaration.
+ //
+ while (DECL_TEMPLATE_INFO (decl))
+ decl = DECL_TI_TEMPLATE (decl);
+
+ bool& tr1 (features.tr1_pointer);
+ bool& boost (features.boost_pointer);
+
+ string n (decl_as_string (decl, TFF_PLAIN_IDENTIFIER));
+
+ // In case of a boost TR1 implementation, we cannot distinguish
+ // between the boost:: and std::tr1:: usage since the latter is
+ // just a using-declaration for the former.
+ //
+ tr1 = tr1
+ || n.compare (0, 8, "std::tr1") == 0
+ || n.compare (0, 10, "::std::tr1") == 0;
+
+ boost = boost
+ || n.compare (0, 17, "boost::shared_ptr") == 0
+ || n.compare (0, 19, "::boost::shared_ptr") == 0;
+ }
+
t.set ("wrapper", true);
return true;
}