]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/conversion/test/implicit_cast.cpp
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)
6 #include <boost/implicit_cast.hpp>
7 #include <boost/detail/lightweight_test.hpp>
8 #include <boost/type.hpp>
9 using boost::implicit_cast
;
13 type
<T
> check_return(T
) { return type
<T
>(); }
18 operator long() const { return 0; }
21 typedef type
<long> long_type
;
22 typedef type
<foo
> foo_type
;
26 type
<long> x
= check_return(boost::implicit_cast
<long>(1));
27 BOOST_TEST(boost::implicit_cast
<long>(1) == 1L);
29 type
<foo
> f
= check_return(boost::implicit_cast
<foo
>("hello"));
30 type
<long> z
= check_return(boost::implicit_cast
<long>(foo("hello")));
32 // warning suppression:
37 return boost::report_errors();