// - casts.hpp -- BLambda Library ------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see http://www.boost.org // ----------------------------------------------- #if !defined(BOOST_LAMBDA_CASTS_HPP) #define BOOST_LAMBDA_CASTS_HPP #include "boost/lambda/detail/suppress_unused.hpp" #include "boost/lambda/core.hpp" #include namespace boost { namespace lambda { template struct return_type_N; template class cast_action; template class static_cast_action; template class dynamic_cast_action; template class const_cast_action; template class reinterpret_cast_action; class typeid_action; class sizeof_action; // Cast actions template class cast_action > { public: template static RET apply(Arg1 &a1) { return static_cast(a1); } }; template class cast_action > { public: template static RET apply(Arg1 &a1) { return dynamic_cast(a1); } }; template class cast_action > { public: template static RET apply(Arg1 &a1) { return const_cast(a1); } }; template class cast_action > { public: template static RET apply(Arg1 &a1) { return reinterpret_cast(a1); } }; // typeid action class typeid_action { public: template static RET apply(Arg1 &a1) { detail::suppress_unused_variable_warnings(a1); return typeid(a1); } }; // sizeof action class sizeof_action { public: template static RET apply(Arg1 &a1) { return sizeof(a1); } }; // return types of casting lambda_functors (all "T" type.) template