]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_erasure/example/convert.cpp
1 // Boost.TypeErasure library
3 // Copyright 2012 Steven Watanabe
5 // Distributed under the Boost Software License Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <boost/type_erasure/any.hpp>
12 #include <boost/type_erasure/builtin.hpp>
13 #include <boost/type_erasure/operators.hpp>
16 namespace mpl
= boost::mpl
;
17 using namespace boost::type_erasure
;
22 An __any can be converted to another __any
23 as long as the conversion is an "upcast."
43 This conversion is okay because the requirements of `common_any`
44 are a subset of the requirements of `any_printable`. Conversion
45 in the other direction is illegal.
49 any_printable y(x); // error
56 //` (For the source of the examples in this section see
57 //` [@boost:/libs/type_erasure/example/convert.cpp convert.cpp])