1 #ifndef BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
2 #define BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // is_default_constructible.hpp: serialization for loading stl collections
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)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
21 #if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
22 #include <type_traits>
24 namespace serialization {
28 struct is_default_constructible : public std::is_default_constructible<T> {};
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>
41 namespace serialization {
45 struct is_default_constructible : public boost::has_trivial_constructor<T> {};
54 #endif // BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP