From a7e3df85fd7180aa0daf0947e50b08d51b7e2380 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Jul 2015 20:08:05 +0200 Subject: Add support for defining views as class template instantiations --- odb/pragma.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'odb/pragma.cxx') diff --git a/odb/pragma.cxx b/odb/pragma.cxx index 046140e..11e1d4e 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -4335,8 +4335,8 @@ register_odb_pragmas (void*, void*) void post_process_pragmas () { - // Make sure object and composite class template instantiations are fully - // instantiated. + // Make sure object, view, and composite class template instantiations + // are fully instantiated. // for (decl_pragmas::iterator i (decl_pragmas_.begin ()), e (decl_pragmas_.end ()); i != e; ++i) @@ -4349,7 +4349,7 @@ post_process_pragmas () if (!(CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type))) continue; - // Check whether this is an object or composite value type. + // Check whether this is an object, view, or composite value type. // pragma const* p (0); string diag_name; @@ -4365,10 +4365,17 @@ post_process_pragmas () diag_name = "persistent object"; break; } + else if (name == "view") + { + p = &*j; + diag_name = "view"; + break; + } else if (name == "value") { p = &*j; diag_name = "composite value"; + break; } // We don't want to instantiate simple values since they may be // incomplete. -- cgit v1.1