From 1cddfd09a7007f77fc243f178b1ca88ea4d0f4f6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Nov 2010 12:02:07 +0200 Subject: Add common implementation of typeinfo comparator --- odb/details/type-info.hxx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 odb/details/type-info.hxx 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 +// 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 + +#include + +#include + +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 + +#endif // ODB_DETAILS_TYPE_INFO_HXX -- cgit v1.1