fail_any_cast_pointer_to_ref.cpp 549 B

12345678910111213141516171819202122
  1. // Boost.TypeErasure library
  2. //
  3. // Copyright 2011 Steven Watanabe
  4. //
  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)
  8. //
  9. // $Id$
  10. #include <boost/type_erasure/any.hpp>
  11. #include <boost/type_erasure/builtin.hpp>
  12. #include <boost/type_erasure/any_cast.hpp>
  13. #include <boost/mpl/vector.hpp>
  14. using namespace boost::type_erasure;
  15. int main()
  16. {
  17. any< ::boost::mpl::vector<copy_constructible<>, typeid_<> > > y(2);
  18. int i = any_cast<int&>(&y);
  19. }