fix doc example typo
[boost.git] / boost / serialization / is_bitwise_serializable.hpp
blob97d80b9a5b56444c4550dc60108acfeda1e5e025
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)
21 # pragma once
22 #endif
24 #include <boost/mpl/bool.hpp>
25 #include <boost/type_traits/is_arithmetic.hpp>
27 namespace boost {
28 namespace serialization {
29 template<class T>
30 struct is_bitwise_serializable
31 : public is_arithmetic<T>
32 {};
33 } // namespace serialization
34 } // namespace boost
37 // define a macro to make explicit designation of this more transparent
38 #define BOOST_IS_BITWISE_SERIALIZABLE(T) \
39 namespace boost { \
40 namespace serialization { \
41 template<> \
42 struct is_bitwise_serializable< T > : mpl::true_ {}; \
43 }} \
44 /**/
46 #endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP