| 1 | #ifndef BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP |
| 2 | #define BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP |
| 3 | |
| 4 | // MS compatible compilers support #pragma once |
| 5 | #if defined(_MSC_VER) |
| 6 | # pragma once |
| 7 | #endif |
| 8 | |
| 9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
| 10 | // is_default_constructible.hpp: serialization for loading stl collections |
| 11 | // |
| 12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
| 13 | // Use, modification and distribution is subject to the Boost Software |
| 14 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 15 | // http://www.boost.org/LICENSE_1_0.txt) |
| 16 | |
| 17 | // See http://www.boost.org for updates, documentation, and revision history. |
| 18 | |
| 19 | #include <boost/config.hpp> |
| 20 | |
| 21 | #if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) |
| 22 | #include <type_traits> |
| 23 | namespace boost{ |
| 24 | namespace serialization { |
| 25 | namespace detail { |
| 26 | |
| 27 | template<typename T> |
| 28 | struct is_default_constructible : public std::is_default_constructible<T> {}; |
| 29 | |
| 30 | } // detail |
| 31 | } // serializaition |
| 32 | } // boost |
| 33 | #else |
| 34 | // we don't have standard library support for is_default_constructible |
| 35 | // so we fake it by using boost::has_trivial_construtor. But this is not |
| 36 | // actually correct because it's possible that a default constructor |
| 37 | // to be non trivial. So when using this, make sure you're not using your |
| 38 | // own definition of of T() but are using the actual default one! |
| 39 | #include <boost/type_traits/has_trivial_constructor.hpp> |
| 40 | namespace boost{ |
| 41 | namespace serialization { |
| 42 | namespace detail { |
| 43 | |
| 44 | template<typename T> |
| 45 | struct is_default_constructible : public boost::has_trivial_constructor<T> {}; |
| 46 | |
| 47 | } // detail |
| 48 | } // serializaition |
| 49 | } // boost |
| 50 | |
| 51 | #endif |
| 52 | |
| 53 | |
| 54 | #endif // BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP |
| 55 | |