[odb-users] mapping complex, templatized value types

Christian Sell christian at gsvitec.com
Sat Sep 19 11:21:09 EDT 2015


will try.. however, I just realized that I still was on 2.3 and therefore
decided to quickly upgrade.. quickly.. first, I was not able to install
libodb-qt, because it didnt find my valid Qt 5.5 install. All attempts to fix
this via command line options failed. Then I installed the rest, ran my
makefile, and got

In file included from /usr/local/include/odb/forward.hxx:10:0,
                 from /usr/local/include/odb/nullable.hxx:10,
                 from /usr/local/include/odb/wrapper-traits.hxx:12,
                 from <standard-odb-epilogue>:5:
/opt/odb-2.4.0-x86_64-linux-gnu/lib/odb/x86_64-linux-gnu/include/c++/4.9.3/cstddef:51:11:
error: ‘::max_align_t’ has not been declared

so I am stuck for now..

> Boris Kolpackov <boris at codesynthesis.com> hat am 19. September 2015 um 15:55
> geschrieben:
>
>
> Hi Christian,
>
> Christian Sell <christian at gsvitec.com> writes:
>
> > template instances do not work, neither directly nor through
> > alias or typedef
>
> Strange, this should work and appear to work for me:
>
> $ cat test.hxx
>
> #include <memory>
> #include <utility>
>
> using int_pair = std::pair<int, int>;
> #pragma db value(int_pair) type("TEXT")
>
> using shared_short_pair = std::shared_ptr<std::pair<short, short>>;
> #pragma db value(shared_short_pair) type("TEXT")
>
> #pragma db object
> struct object
> {
> #pragma db id
> int id;
>
> int_pair ip;
> std::pair<int, int> ip1;
>
> std::shared_ptr<int_pair> sip; // Ok, shared_ptr is a wrapper (Section 7.3).
>
> shared_short_pair ssp;
> std::shared_ptr<std::pair<short, short>> ssp1;
> };
>
> $ odb -d sqlite -s --std c++11 test.hxx
>
> Can you try to adjust this example to reproduce your problem?
>
> Boris
Christian Sell



More information about the odb-users mailing list