From 8a9e1081c026a092c7dfb28fbd079b88850c7233 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Mar 2012 12:34:54 +0200 Subject: Portability workarounds for incomplete C++11 support in VC++ and old GCC --- odb/tr1/lazy-ptr.hxx | 6 +++--- odb/tr1/pointer-traits.hxx | 9 +++++++++ odb/tr1/wrapper-traits.hxx | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'odb/tr1') diff --git a/odb/tr1/lazy-ptr.hxx b/odb/tr1/lazy-ptr.hxx index ad6e283..01a7b36 100644 --- a/odb/tr1/lazy-ptr.hxx +++ b/odb/tr1/lazy-ptr.hxx @@ -111,10 +111,10 @@ namespace odb template void reset (database_type&, std::auto_ptr&); template void reset (database_type&, const std::tr1::shared_ptr&); -#ifdef ODB_CXX11 +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT template #else - template + template #endif typename object_traits::id_type object_id () const; @@ -218,7 +218,7 @@ namespace odb // The object_id() function can only be called when the object is // persistent, or: expired() XOR loaded() (can use != for XOR). // -#ifdef ODB_CXX11 +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT template #else template diff --git a/odb/tr1/pointer-traits.hxx b/odb/tr1/pointer-traits.hxx index 5ba1b93..12e1164 100644 --- a/odb/tr1/pointer-traits.hxx +++ b/odb/tr1/pointer-traits.hxx @@ -7,6 +7,13 @@ #include +#include // ODB_CXX11 + +// In VC++ std::shared_ptr and std::tr1::shared_ptr is the same class +// template. One is just a using-declaration for the other. +// +#if !(defined(ODB_CXX11) && defined(_MSC_VER)) + // // This header assumes that the necessary TR1 header has already // been included. @@ -94,6 +101,8 @@ namespace odb }; } +#endif // !(ODB_CXX11 && _MSC_VER) + #include #endif // ODB_TR1_POINTER_TRAITS_HXX diff --git a/odb/tr1/wrapper-traits.hxx b/odb/tr1/wrapper-traits.hxx index ebc41bc..7d159d4 100644 --- a/odb/tr1/wrapper-traits.hxx +++ b/odb/tr1/wrapper-traits.hxx @@ -7,6 +7,13 @@ #include +#include // ODB_CXX11 + +// In VC++ std::shared_ptr and std::tr1::shared_ptr is the same class +// template. One is just a using-declaration for the other. +// +#if !(defined(ODB_CXX11) && defined(_MSC_VER)) + // // This header assumes that the necessary TR1 header has already // been included. @@ -63,6 +70,8 @@ namespace odb }; } +#endif // !(ODB_CXX11 && _MSC_VER) + #include #endif // ODB_TR1_WRAPPER_TRAITS_HXX -- cgit v1.1