From b59214c08549043cb5812c025159c49d6f9efe01 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Aug 2010 11:25:20 +0200 Subject: Test automatic id assignment --- common/auto/test.hxx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 common/auto/test.hxx (limited to 'common/auto/test.hxx') diff --git a/common/auto/test.hxx b/common/auto/test.hxx new file mode 100644 index 0000000..c23027e --- /dev/null +++ b/common/auto/test.hxx @@ -0,0 +1,33 @@ +// file : common/auto/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma odb object +struct object +{ + object (const std::string& str) + : id_ (1), str_ (str) + { + } + + #pragma odb auto id + unsigned long id_; + std::string str_; + +private: + object () + { + } + + friend class odb::access; +}; + +#endif // TEST_HXX -- cgit v1.1