/*************************************************************************** * Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht * * Copyright (c) QuantStack * * * * Distributed under the terms of the BSD 3-Clause License. * * * * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ #ifndef XTL_XMETA_UTILS_HPP #define XTL_XMETA_UTILS_HPP #include #include #include #include "xfunctional.hpp" #include "xtl_config.hpp" namespace xtl { // TODO move to a xutils if we have one // gcc 4.9 is affected by C++14 defect CGW 1558 // see http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558 template struct make_void { using type = void; }; template using void_t = typename make_void::type; namespace mpl { /************* * mpl types * *************/ template struct vector { }; template using bool_ = std::integral_constant; template using size_t_ = std::integral_constant; /******* * if_ * *******/ template struct if_c : std::conditional { }; template using if_c_t = typename if_c::type; template struct if_ : if_c { }; template using if_t = typename if_::type; /*********** * eval_if * ***********/ template struct eval_if_c { using type = typename T::type; }; template struct eval_if_c { using type = typename F::type; }; template struct eval_if : eval_if_c { }; template using eval_if_t = typename eval_if::type; /******** * cast * ********/ namespace detail { template class B> struct cast_impl; template