diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-22 12:02:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-22 12:02:07 +0200 |
commit | 1cddfd09a7007f77fc243f178b1ca88ea4d0f4f6 (patch) | |
tree | 85c5ddaf57fdb2078dfb9cc8db3cd1cec134cbda | |
parent | cd09ab74e179fd4c42ad226fd5cc609485a8df01 (diff) |
Add common implementation of typeinfo comparator
-rw-r--r-- | odb/details/type-info.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/odb/details/type-info.hxx b/odb/details/type-info.hxx new file mode 100644 index 0000000..656b789 --- /dev/null +++ b/odb/details/type-info.hxx @@ -0,0 +1,40 @@ +// file : odb/details/type-info.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_DETAILS_TYPE_INFO_HXX +#define ODB_DETAILS_TYPE_INFO_HXX + +#include <odb/pre.hxx> + +#include <typeinfo> + +#include <odb/details/export.hxx> + +namespace odb +{ + namespace details + { + struct LIBODB_EXPORT type_info_comparator + { + bool + operator() (const std::type_info* x, const std::type_info* y) const + { + // XL C++ on AIX has buggy type_info::before() in that + // it returns true for two different type_info objects + // that happened to be for the same type. + // +#if defined(__xlC__) && defined(_AIX) + return *x != *y && x->before (*y); +#else + return x->before (*y); +#endif + } + }; + } +} + +#include <odb/post.hxx> + +#endif // ODB_DETAILS_TYPE_INFO_HXX |