diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-10 15:17:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-10 15:17:16 +0200 |
commit | b8554760aa3a5c5697c77d11e507a2bb46dbf8e4 (patch) | |
tree | 3f2bcb28a59eb0d4cce4586acec4a8c639cde7e6 /odb/pragma.hxx | |
parent | 1b64460a2b2c5411b6052cd4c4d8e8b0d46a4086 (diff) |
Add support for custom database type mapping
New pragma qualifier, map, and specifiers: as, to, from. New tests:
<database>/custom.
Diffstat (limited to 'odb/pragma.hxx')
-rw-r--r-- | odb/pragma.hxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/odb/pragma.hxx b/odb/pragma.hxx index a71c49c..ac64346 100644 --- a/odb/pragma.hxx +++ b/odb/pragma.hxx @@ -74,16 +74,17 @@ struct pragma_set: std::set<pragma> { typedef std::set<pragma> base; - void + pragma& insert (pragma const& p) { std::pair<iterator, bool> r (base::insert (p)); + pragma& x (const_cast<pragma&> (*r.first)); + if (!r.second) - { - pragma& x (const_cast<pragma&> (*r.first)); x = p; - } + + return x; } template <typename I> |