New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sp_typeinfo.hpp in vendors/XIOS/current/extern/boost/include/boost/detail – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/detail/sp_typeinfo.hpp @ 3428

Last change on this file since 3428 was 3428, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

File size: 2.1 KB
Line 
1#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
2#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
3
4// MS compatible compilers support #pragma once
5
6#if defined(_MSC_VER) && (_MSC_VER >= 1020)
7# pragma once
8#endif
9
10//  detail/sp_typeinfo.hpp
11//
12//  Copyright 2007 Peter Dimov
13//
14// Distributed under the Boost Software License, Version 1.0.
15// See accompanying file LICENSE_1_0.txt or copy at
16// http://www.boost.org/LICENSE_1_0.txt)
17
18#include <boost/config.hpp>
19
20#if defined( BOOST_NO_TYPEID )
21
22#include <boost/current_function.hpp>
23#include <functional>
24
25namespace boost
26{
27
28namespace detail
29{
30
31class sp_typeinfo
32{
33private:
34
35    sp_typeinfo( sp_typeinfo const& );
36    sp_typeinfo& operator=( sp_typeinfo const& );
37
38    char const * name_;
39
40public:
41
42    explicit sp_typeinfo( char const * name ): name_( name )
43    {
44    }
45
46    bool operator==( sp_typeinfo const& rhs ) const
47    {
48        return this == &rhs;
49    }
50
51    bool operator!=( sp_typeinfo const& rhs ) const
52    {
53        return this != &rhs;
54    }
55
56    bool before( sp_typeinfo const& rhs ) const
57    {
58        return std::less< sp_typeinfo const* >()( this, &rhs );
59    }
60
61    char const* name() const
62    {
63        return name_;
64    }
65};
66
67template<class T> struct sp_typeid_
68{
69    static sp_typeinfo ti_;
70
71    static char const * name()
72    {
73        return BOOST_CURRENT_FUNCTION;
74    }
75};
76
77template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
78
79template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
80{
81};
82
83template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
84{
85};
86
87template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
88{
89};
90
91template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
92{
93};
94
95} // namespace detail
96
97} // namespace boost
98
99#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
100
101#else
102
103#include <typeinfo>
104
105namespace boost
106{
107
108namespace detail
109{
110
111#if defined( BOOST_NO_STD_TYPEINFO )
112
113typedef ::type_info sp_typeinfo;
114
115#else
116
117typedef std::type_info sp_typeinfo;
118
119#endif
120
121} // namespace detail
122
123} // namespace boost
124
125#define BOOST_SP_TYPEID(T) typeid(T)
126
127#endif
128
129#endif  // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
Note: See TracBrowser for help on using the repository browser.