]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/smart_ptr/detail/sp_convertible.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
4e321906eae58b871d453e052e6f08fe46e96296
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / smart_ptr / detail / sp_convertible.hpp
1 #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED\r
2 #define BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED\r
3 \r
4 // MS compatible compilers support #pragma once\r
5 \r
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
7 # pragma once\r
8 #endif\r
9 \r
10 //  detail/sp_convertible.hpp\r
11 //\r
12 //  Copyright 2008 Peter Dimov\r
13 //\r
14 //  Distributed under the Boost Software License, Version 1.0.\r
15 //  See accompanying file LICENSE_1_0.txt or copy at\r
16 //  http://www.boost.org/LICENSE_1_0.txt\r
17 \r
18 #include <boost/config.hpp>\r
19 \r
20 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE )\r
21 # define BOOST_SP_NO_SP_CONVERTIBLE\r
22 #endif\r
23 \r
24 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 )\r
25 # define BOOST_SP_NO_SP_CONVERTIBLE\r
26 #endif\r
27 \r
28 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x620 )\r
29 # define BOOST_SP_NO_SP_CONVERTIBLE\r
30 #endif\r
31 \r
32 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE )\r
33 \r
34 namespace boost\r
35 {\r
36 \r
37 namespace detail\r
38 {\r
39 \r
40 template< class Y, class T > struct sp_convertible\r
41 {\r
42     typedef char (&yes) [1];\r
43     typedef char (&no)  [2];\r
44 \r
45     static yes f( T* );\r
46     static no  f( ... );\r
47 \r
48     enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };\r
49 };\r
50 \r
51 struct sp_empty\r
52 {\r
53 };\r
54 \r
55 template< bool > struct sp_enable_if_convertible_impl;\r
56 \r
57 template<> struct sp_enable_if_convertible_impl<true>\r
58 {\r
59     typedef sp_empty type;\r
60 };\r
61 \r
62 template<> struct sp_enable_if_convertible_impl<false>\r
63 {\r
64 };\r
65 \r
66 template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_if_convertible_impl< sp_convertible< Y, T >::value >\r
67 {\r
68 };\r
69 \r
70 } // namespace detail\r
71 \r
72 } // namespace boost\r
73 \r
74 #endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE )\r
75 \r
76 #endif  // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED\r