using.hpp 827 B

123456789101112131415161718192021
  1. /*=============================================================================
  2. Copyright (c) 2016 Paul Fultz II
  3. using.hpp
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #ifndef BOOST_HOF_GUARD_USING_HPP
  8. #define BOOST_HOF_GUARD_USING_HPP
  9. #include <boost/hof/config.hpp>
  10. #if BOOST_HOF_HAS_TEMPLATE_ALIAS
  11. #define BOOST_HOF_USING(name, ...) using name = __VA_ARGS__
  12. #define BOOST_HOF_USING_TYPENAME(name, ...) using name = typename __VA_ARGS__
  13. #else
  14. #define BOOST_HOF_USING(name, ...) struct name : std::enable_if<true, __VA_ARGS__>::type {}
  15. #define BOOST_HOF_USING_TYPENAME(name, ...) struct name : __VA_ARGS__ {}
  16. #endif
  17. #endif