Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:08:13

0001 // (C) Copyright 2007 Matthias Troyer
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Authors: Matthias Troyer
0008 
0009 /** @file is_bitwise_serializable.hpp
0010  *
0011  *  This header provides a traits class for determining whether a class
0012  * can be serialized (in a non-portable way) just by copying the bits.
0013  */
0014 
0015 
0016 #ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
0017 #define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
0018 
0019 // MS compatible compilers support #pragma once
0020 #if defined(_MSC_VER)
0021 # pragma once
0022 #endif
0023 
0024 #include <boost/mpl/bool_fwd.hpp>
0025 #include <boost/type_traits/is_arithmetic.hpp>
0026 
0027 namespace boost {
0028 namespace serialization {
0029     template<class T>
0030     struct is_bitwise_serializable
0031      : public is_arithmetic< T >
0032     {};
0033 } // namespace serialization
0034 } // namespace boost
0035 
0036 
0037 // define a macro to make explicit designation of this more transparent
0038 #define BOOST_IS_BITWISE_SERIALIZABLE(T)              \
0039 namespace boost {                                     \
0040 namespace serialization {                             \
0041 template<>                                            \
0042 struct is_bitwise_serializable< T > : mpl::true_ {};  \
0043 }}                                                    \
0044 /**/
0045 
0046 #endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP