[odb-users] virtual data member and odb::nullable

Boris Kolpackov boris at codesynthesis.com
Sat Feb 7 09:00:51 EST 2015


Hi Dieter,

dieter.govaerts at bricsys.com <dieter.govaerts at bricsys.com> writes:

> It seems that I can't declare a virtual datamember that is an
> odb::nullable. The odb compiler shows the following error:
> 
> error: name 'odb::nullable' in db pragma virtual does not refer to a type
> 
> #pragma db member(variable_layer) virtual(odb::nullable<unsigned char>) ...

You can do this, you just need to give odb::nullable<unsigned char>
a name:

typedef odb::nullable<unsigned char> variable_layer_type;
#pragma db member(variable_layer) virtual(variable_layer_type) ...

It is an annoying limitation (and I've added an item to our TODO list)
but fairly hard to resolve, technically.

Boris



More information about the odb-users mailing list