author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright David Abrahams 2003. |
williamr@2 | 2 |
// Distributed under the Boost Software License, Version 1.0. (See |
williamr@2 | 3 |
// accompanying file LICENSE_1_0.txt or copy at |
williamr@2 | 4 |
// http://www.boost.org/LICENSE_1_0.txt) |
williamr@2 | 5 |
#ifndef IMPLICIT_CAST_DWA200356_HPP |
williamr@2 | 6 |
# define IMPLICIT_CAST_DWA200356_HPP |
williamr@2 | 7 |
|
williamr@2 | 8 |
# include <boost/mpl/identity.hpp> |
williamr@2 | 9 |
|
williamr@2 | 10 |
namespace boost { |
williamr@2 | 11 |
|
williamr@2 | 12 |
// implementation originally suggested by C. Green in |
williamr@2 | 13 |
// http://lists.boost.org/MailArchives/boost/msg00886.php |
williamr@2 | 14 |
|
williamr@2 | 15 |
// The use of identity creates a non-deduced form, so that the |
williamr@2 | 16 |
// explicit template argument must be supplied |
williamr@2 | 17 |
template <typename T> |
williamr@2 | 18 |
inline T implicit_cast (typename mpl::identity<T>::type x) { |
williamr@2 | 19 |
return x; |
williamr@2 | 20 |
} |
williamr@2 | 21 |
|
williamr@2 | 22 |
// incomplete return type now is here |
williamr@2 | 23 |
//template <typename T> |
williamr@2 | 24 |
//void implicit_cast (...); |
williamr@2 | 25 |
|
williamr@2 | 26 |
|
williamr@2 | 27 |
} // namespace boost |
williamr@2 | 28 |
|
williamr@2 | 29 |
#endif // IMPLICIT_CAST_DWA200356_HPP |