Chris@16: // Copyright David Abrahams 2003. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef IMPLICIT_CAST_DWA200356_HPP Chris@16: # define IMPLICIT_CAST_DWA200356_HPP Chris@16: Chris@101: namespace boost { Chris@16: Chris@101: namespace detail { Chris@101: Chris@101: template struct icast_identity Chris@101: { Chris@101: typedef T type; Chris@101: }; Chris@101: Chris@101: } // namespace detail Chris@16: Chris@16: // implementation originally suggested by C. Green in Chris@16: // http://lists.boost.org/MailArchives/boost/msg00886.php Chris@16: Chris@16: // The use of identity creates a non-deduced form, so that the Chris@16: // explicit template argument must be supplied Chris@16: template Chris@101: inline T implicit_cast (typename boost::detail::icast_identity::type x) { Chris@16: return x; Chris@16: } Chris@16: Chris@16: // incomplete return type now is here Chris@16: //template Chris@16: //void implicit_cast (...); Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: #endif // IMPLICIT_CAST_DWA200356_HPP