Chris@16: // (C) Copyright 2007 Matthias Troyer Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // Authors: Matthias Troyer Chris@16: Chris@16: /** @file is_bitwise_serializable.hpp Chris@16: * Chris@16: * This header provides a traits class for determining whether a class Chris@16: * can be serialized (in a non-portable way) just by copying the bits. Chris@16: */ Chris@16: Chris@16: Chris@16: #ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP Chris@16: #define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace serialization { Chris@16: template Chris@16: struct is_bitwise_serializable Chris@16: : public is_arithmetic< T > Chris@16: {}; Chris@16: } // namespace serialization Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: // define a macro to make explicit designation of this more transparent Chris@16: #define BOOST_IS_BITWISE_SERIALIZABLE(T) \ Chris@16: namespace boost { \ Chris@16: namespace serialization { \ Chris@16: template<> \ Chris@16: struct is_bitwise_serializable< T > : mpl::true_ {}; \ Chris@16: }} \ Chris@16: /**/ Chris@16: Chris@16: #endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP