From b8554760aa3a5c5697c77d11e507a2bb46dbf8e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2012 15:17:16 +0200 Subject: Add support for custom database type mapping New pragma qualifier, map, and specifiers: as, to, from. New tests: /custom. --- odb/pragma.hxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'odb/pragma.hxx') 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 { typedef std::set base; - void + pragma& insert (pragma const& p) { std::pair r (base::insert (p)); + pragma& x (const_cast (*r.first)); + if (!r.second) - { - pragma& x (const_cast (*r.first)); x = p; - } + + return x; } template -- cgit v1.1