make_void.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Copyright 2017 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under the Boost Software License,
  5. Version 1.0. (See accompanying file LICENSE_1_0.txt
  6. or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_TT_MAKE_VOID_HPP_INCLUDED
  9. #define BOOST_TT_MAKE_VOID_HPP_INCLUDED
  10. #include <boost/config.hpp>
  11. namespace boost {
  12. #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
  13. template<class...>
  14. struct make_void {
  15. typedef void type;
  16. };
  17. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  18. template<class... Ts>
  19. using void_t = typename make_void<Ts...>::type;
  20. #endif
  21. #else /* BOOST_NO_CXX11_VARIADIC_TEMPLATES */
  22. template<class = void,
  23. class = void,
  24. class = void,
  25. class = void,
  26. class = void>
  27. struct make_void {
  28. typedef void type;
  29. };
  30. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  31. template<class A = void,
  32. class B = void,
  33. class C = void,
  34. class D = void,
  35. class E = void>
  36. using void_t = typename make_void<A, B, C, D, E>::type;
  37. #endif
  38. #endif
  39. } /* boost */
  40. #endif