1 // (C) Copyright 2007 Matthias Troyer
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Authors: Matthias Troyer
9 /** @file is_bitwise_serializable.hpp
11 * This header provides a traits class for determining whether a class
12 * can be serialized (in a non-portable way) just by copying the bits.
16 #ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
17 #define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
19 // MS compatible compilers support #pragma once
20 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
24 #include <boost/mpl/bool.hpp>
25 #include <boost/type_traits/is_arithmetic.hpp>
28 namespace serialization
{
30 struct is_bitwise_serializable
31 : public is_arithmetic
<T
>
33 } // namespace serialization
37 // define a macro to make explicit designation of this more transparent
38 #define BOOST_IS_BITWISE_SERIALIZABLE(T) \
40 namespace serialization { \
42 struct is_bitwise_serializable< T > : mpl::true_ {}; \
46 #endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP