[odb-users] reuse inheritance with templated base class

Boris Kolpackov boris at codesynthesis.com
Wed Aug 13 09:06:57 EDT 2014


Hi Michael,

Michael Powell <mwpowellhtx at gmail.com> writes:

> >> typedef std::pair<T, std::string> Item;
> >> #pragma db value(Item)
> 
> If you stop and think about how preprocessor and compile time
> (template) issues are resolved, this makes perfect sense. ODB does not
> have enough information to preprocess the type at that time.

Well, what ODB could have done is "assign" the value pragma to the
Item template (becomes a "pragma template", in a sense). Then, when
it is instantiated (i.e., the outer class template is instantiated),
apply this pragma to the instantiated Item.

Of course, this is the level of complexity that I would prefer to
avoid ;-).

Boris



More information about the odb-users mailing list