source: NonGTP/Boost/boost/serialization/is_abstract.hpp @ 857

Revision 857, 2.0 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
2#define BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
3
4// MS compatible compilers support #pragma once
5#if defined(_MSC_VER) && (_MSC_VER >= 1020)
6# pragma once
7#endif
8
9/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10// is_abstract_class.hpp:
11
12// (C) Copyright 2002 Rani Sharoni (rani_sharoni@hotmail.com) and 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)
16
17//  See http://www.boost.org for updates, documentation, and revision history.
18
19#include <boost/config.hpp>
20#include <boost/mpl/bool.hpp>
21#include <boost/type_traits/is_abstract.hpp>
22
23namespace boost {
24namespace serialization {
25    template<class T>
26    struct is_abstract {
27        // default to false if not supported
28        #ifdef BOOST_NO_IS_ABSTRACT
29            typedef BOOST_DEDUCED_TYPENAME mpl::bool_<false> type;
30            BOOST_STATIC_CONSTANT(bool, value = false);
31        #else
32            typedef BOOST_DEDUCED_TYPENAME boost::is_abstract<T>::type type;
33            BOOST_STATIC_CONSTANT(bool, value = type::value);
34        #endif
35    };
36} // namespace serialization
37} // namespace boost
38
39// define a macro to make explicit designation of this more transparent
40#define BOOST_IS_ABSTRACT(T)                          \
41namespace boost {                                     \
42namespace serialization {                             \
43template<>                                            \
44struct is_abstract< T > {                             \
45    typedef mpl::bool_<true> type;                    \
46    BOOST_STATIC_CONSTANT(bool, value = true);        \
47};                                                    \
48}                                                     \
49}                                                     \
50/**/
51
52#endif //BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
Note: See TracBrowser for help on using the repository browser.