sl@0
|
1 |
#ifndef BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|
sl@0
|
2 |
#define BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|
sl@0
|
3 |
|
sl@0
|
4 |
// MS compatible compilers support #pragma once
|
sl@0
|
5 |
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
sl@0
|
6 |
# pragma once
|
sl@0
|
7 |
#endif
|
sl@0
|
8 |
|
sl@0
|
9 |
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
sl@0
|
10 |
// is_abstract_class.hpp:
|
sl@0
|
11 |
|
sl@0
|
12 |
// (C) Copyright 2002 Rani Sharoni (rani_sharoni@hotmail.com) and Robert Ramey
|
sl@0
|
13 |
// Use, modification and distribution is subject to the Boost Software
|
sl@0
|
14 |
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
15 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
16 |
|
sl@0
|
17 |
// See http://www.boost.org for updates, documentation, and revision history.
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <boost/config.hpp>
|
sl@0
|
20 |
#include <boost/mpl/bool.hpp>
|
sl@0
|
21 |
#include <boost/type_traits/is_abstract.hpp>
|
sl@0
|
22 |
|
sl@0
|
23 |
namespace boost {
|
sl@0
|
24 |
namespace serialization {
|
sl@0
|
25 |
template<class T>
|
sl@0
|
26 |
struct is_abstract {
|
sl@0
|
27 |
// default to false if not supported
|
sl@0
|
28 |
#ifdef BOOST_NO_IS_ABSTRACT
|
sl@0
|
29 |
typedef BOOST_DEDUCED_TYPENAME mpl::bool_<false> type;
|
sl@0
|
30 |
BOOST_STATIC_CONSTANT(bool, value = false);
|
sl@0
|
31 |
#else
|
sl@0
|
32 |
typedef BOOST_DEDUCED_TYPENAME boost::is_abstract<T>::type type;
|
sl@0
|
33 |
BOOST_STATIC_CONSTANT(bool, value = type::value);
|
sl@0
|
34 |
#endif
|
sl@0
|
35 |
};
|
sl@0
|
36 |
} // namespace serialization
|
sl@0
|
37 |
} // namespace boost
|
sl@0
|
38 |
|
sl@0
|
39 |
// define a macro to make explicit designation of this more transparent
|
sl@0
|
40 |
#define BOOST_IS_ABSTRACT(T) \
|
sl@0
|
41 |
namespace boost { \
|
sl@0
|
42 |
namespace serialization { \
|
sl@0
|
43 |
template<> \
|
sl@0
|
44 |
struct is_abstract< T > { \
|
sl@0
|
45 |
typedef mpl::bool_<true> type; \
|
sl@0
|
46 |
BOOST_STATIC_CONSTANT(bool, value = true); \
|
sl@0
|
47 |
}; \
|
sl@0
|
48 |
} \
|
sl@0
|
49 |
} \
|
sl@0
|
50 |
/**/
|
sl@0
|
51 |
|
sl@0
|
52 |
#endif //BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|