From f0a66d46cc013c301ed905c31fca50eefd67a874 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Dec 2013 10:20:12 +0200 Subject: Diagnose inverse maps --- odb/processor.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/odb/processor.cxx b/odb/processor.cxx index 89905c2..0964645 100644 --- a/odb/processor.cxx +++ b/odb/processor.cxx @@ -1825,6 +1825,15 @@ namespace if (kt != 0) process_container_value (*kt, m, "key", false); + // A map cannot be an inverse container. + // + if (m.count ("value-inverse") && (ck == ck_map || ck == ck_multimap)) + { + os << m.file () << ":" << m.line () << ":" << m.column () << ":" + << " error: inverse container cannot be a map" << endl; + throw operation_failed (); + } + // If this is an inverse side of a bidirectional object relationship // and it is an ordered container, mark it as unordred since there is // no concept of order in this construct. -- cgit v1.1