fix doc example typo
[boost.git] / boost / serialization / assume_abstract.hpp
bloba89cc44bd2456c9b338910e2dafdad929d907386
1 #ifndef BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
2 #define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // assume_abstract_class.hpp:
12 // (C) Copyright 2008 Robert Ramey
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 // this is useful for compilers which don't support the boost::is_abstract
21 #include <boost/type_traits/is_abstract.hpp>
23 #ifndef BOOST_NO_IS_ABSTRACT
25 // if there is an intrinsic is_abstract defined, we don't have to do anything
26 #define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)
28 // but forward to the "official" is_abstract
29 namespace boost {
30 namespace serialization {
31 template<class T>
32 struct is_abstract : boost::is_abstract<T> {} ;
33 } // namespace serialization
34 } // namespace boost
36 #else
37 // we have to "make" one
39 namespace boost {
40 namespace serialization {
41 template<class T>
42 struct is_abstract : boost::false_type {};
43 } // namespace serialization
44 } // namespace boost
46 // define a macro to make explicit designation of this more transparent
47 #define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) \
48 namespace boost { \
49 namespace serialization { \
50 template<> \
51 struct is_abstract< T > : boost::true_type {}; \
52 template<> \
53 struct is_abstract< const T > : boost::true_type {}; \
54 }} \
55 /**/
57 #endif // BOOST_NO_IS_ABSTRACT
59 #endif //BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP