AW: AW: [odb-users] Index of member of composite value

Marcel Nehring mne at
Mon Apr 4 04:25:34 EDT 2016

Hi Andreas,

would specifying this in a separate file be an option? ODB pragmas can be in their own files if you specify to which object they belong (named pragmas).
You could then put this in the same file as your composite value definition.

"While keeping the C++ declarations and database declarations close together eases maintenance
and increases readability, we can also place them in different parts of the same header
file or even factor them to a separate file. To achieve this we use the so called named
pragmas. Unlike positioned pragmas, named pragmas explicitly specify the C++ declaration
to which they apply by adding the declaration name after the pragma qualifier."

Following the example from my previous mail:

#pragma db object(object)
#pragma db member(object::p1) index
#pragma db index(object::"p2_xy_i") members(p2.x, p2.y)


More information about the odb-users mailing list