This is Unofficial EPICS BASE Doxygen Site
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
sp_convertible.hpp
Go to the documentation of this file.
1
#ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED
2
#define BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_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_convertible.hpp
11
//
12
// Copyright 2008 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_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE )
21
# define BOOST_SP_NO_SP_CONVERTIBLE
22
#endif
23
24
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 )
25
# define BOOST_SP_NO_SP_CONVERTIBLE
26
#endif
27
28
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x630 )
29
# define BOOST_SP_NO_SP_CONVERTIBLE
30
#endif
31
32
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
33
34
namespace
boost
35
{
36
37
namespace
detail
38
{
39
40
template
<
class
Y,
class
T >
struct
sp_convertible
41
{
42
typedef
char (&
yes
) [1];
43
typedef
char (&
no
) [2];
44
45
static
yes
f
( T* );
46
static
no
f
( ... );
47
48
enum
_vt
{
value
=
sizeof
( (
f
)( static_cast<Y*>(0) ) ) ==
sizeof
(
yes
) };
49
};
50
51
template
<
class
Y,
class
T >
struct
sp_convertible
< Y, T[] >
52
{
53
enum
_vt
{
value
=
false
};
54
};
55
56
template
<
class
Y,
class
T >
struct
sp_convertible
< Y[], T[] >
57
{
58
enum
_vt
{
value
=
sp_convertible< Y[1], T[1] >::value
};
59
};
60
61
template
<
class
Y, std::
size_t
N,
class
T >
struct
sp_convertible
< Y[N], T[] >
62
{
63
enum
_vt
{
value
=
sp_convertible< Y[1], T[1] >::value
};
64
};
65
66
struct
sp_empty
67
{
68
};
69
70
template
<
bool
>
struct
sp_enable_if_convertible_impl
;
71
72
template
<>
struct
sp_enable_if_convertible_impl
<
true
>
73
{
74
typedef
sp_empty
type
;
75
};
76
77
template
<>
struct
sp_enable_if_convertible_impl
<
false
>
78
{
79
};
80
81
template
<
class
Y,
class
T >
struct
sp_enable_if_convertible
:
public
sp_enable_if_convertible_impl
< sp_convertible< Y, T >::value >
82
{
83
};
84
85
}
// namespace detail
86
87
}
// namespace boost
88
89
#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE )
90
91
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED
boost::detail::sp_convertible< Y, T[] >::_vt
_vt
Definition:
sp_convertible.hpp:53
value
Definition:
link.h:174
boost::detail::sp_empty
Definition:
sp_convertible.hpp:66
boost
Definition:
assert.hpp:91
true
#define true
Definition:
flexdef.h:84
boost::detail::sp_convertible::yes
char(& yes)[1]
Definition:
sp_convertible.hpp:42
boost::detail::sp_convertible::no
char(& no)[2]
Definition:
sp_convertible.hpp:43
config.hpp
boost::detail::sp_convertible
Definition:
sp_convertible.hpp:40
boost::detail::sp_convertible< Y[N], T[] >::_vt
_vt
Definition:
sp_convertible.hpp:63
detail
Definition:
pvUnitTest.h:17
boost::detail::sp_enable_if_convertible_impl< true >::type
sp_empty type
Definition:
sp_convertible.hpp:74
boost::detail::sp_enable_if_convertible_impl
Definition:
sp_convertible.hpp:70
boost::detail::sp_enable_if_convertible
Definition:
sp_convertible.hpp:81
boost::detail::sp_convertible< Y[], T[] >::_vt
_vt
Definition:
sp_convertible.hpp:58
boost::detail::sp_convertible::f
static yes f(T *)
false
#define false
Definition:
flexdef.h:85
boost::detail::sp_convertible::_vt
_vt
Definition:
sp_convertible.hpp:48
modules
libcom
vxWorks
boost
smart_ptr
detail
sp_convertible.hpp
Generated by
1.8.11