Mercurial > hg > vamp-build-and-test
diff DEPENDENCIES/generic/include/boost/spirit/home/phoenix/object/static_cast.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DEPENDENCIES/generic/include/boost/spirit/home/phoenix/object/static_cast.hpp Tue Aug 05 11:11:38 2014 +0100 @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + 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) +==============================================================================*/ +#ifndef PHOENIX_OBJECT_STATIC_CAST_HPP +#define PHOENIX_OBJECT_STATIC_CAST_HPP + +#include <boost/spirit/home/phoenix/core/compose.hpp> + +namespace boost { namespace phoenix +{ + namespace impl + { + template <typename T> + struct static_cast_eval + { + template <typename Env, typename U> + struct result + { + typedef T type; + }; + + template <typename RT, typename Env, typename U> + static RT + eval(Env const& env, U& obj) + { + return static_cast<RT>(obj.eval(env)); + } + }; + } + + template <typename T, typename U> + inline actor<typename as_composite<impl::static_cast_eval<T>, U>::type> + static_cast_(U const& obj) + { + return compose<impl::static_cast_eval<T> >(obj); + } +}} + +#endif