diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-03-02 12:34:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-03-02 12:34:54 +0200 |
commit | 8a9e1081c026a092c7dfb28fbd079b88850c7233 (patch) | |
tree | f44ba71ea18365b8d9c1a97c09b624a0c4d150dc /odb/tr1 | |
parent | 0f25b194dcbcfa95a80284069999dd92341ce36d (diff) |
Portability workarounds for incomplete C++11 support in VC++ and old GCC
Diffstat (limited to 'odb/tr1')
-rw-r--r-- | odb/tr1/lazy-ptr.hxx | 6 | ||||
-rw-r--r-- | odb/tr1/pointer-traits.hxx | 9 | ||||
-rw-r--r-- | odb/tr1/wrapper-traits.hxx | 9 |
3 files changed, 21 insertions, 3 deletions
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 <class Y> void reset (database_type&, std::auto_ptr<Y>&); template <class Y> void reset (database_type&, const std::tr1::shared_ptr<Y>&); -#ifdef ODB_CXX11 +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT template <class O = T> #else - template <class O /* = T */> + template <class O /*= T*/> #endif typename object_traits<O>::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 <class O = T> #else template <class O /* = T */> 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 <odb/pre.hxx> +#include <odb/details/config.hxx> // 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 <odb/post.hxx> #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 <odb/pre.hxx> +#include <odb/details/config.hxx> // 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 <odb/post.hxx> #endif // ODB_TR1_WRAPPER_TRAITS_HXX |