1 // Copyright David Abrahams 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef BOOST_IMPLICIT_CAST_DWA200356_HPP
7 #define BOOST_IMPLICIT_CAST_DWA200356_HPP
8 
9 namespace boost {
10 
11 namespace detail {
12 
13 template<class T> struct icast_identity
14 {
15     typedef T type;
16 };
17 
18 } // namespace detail
19 
20 // implementation originally suggested by C. Green in
21 // http://lists.boost.org/MailArchives/boost/msg00886.php
22 
23 // The use of identity creates a non-deduced form, so that the
24 // explicit template argument must be supplied
25 template <typename T>
implicit_cast(typename boost::detail::icast_identity<T>::type x)26 inline T implicit_cast (typename boost::detail::icast_identity<T>::type x) {
27     return x;
28 }
29 
30 } // namespace boost
31 
32 
33 #endif // BOOST_IMPLICIT_CAST_DWA200356_HPP
34