make_void.qbk 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. [section:make_void make_void]
  9. template<class...>
  10. struct make_void
  11. {
  12. typedef void type;
  13. };
  14. template<class... Ts>
  15. using void_t = typename make_void<Ts...>::type;
  16. __type The type `void` for all `T`.
  17. __header ` #include <boost/type_traits/make_void.hpp>` or ` #include <boost/type_traits.hpp>`
  18. [table Examples
  19. [[Expression] [Result Type]]
  20. [[`make_void<int>::type`][`void`]]
  21. [[`make_void<int&>::type`] [`void`]]
  22. [[`make_void<int(*)(int)>::type`] [`void`]]
  23. [[`make_void<int[]>::type`] [`void`]]
  24. [[`make_void<int[1]>::type`] [`void`]]
  25. [[`make_void<>::type`] [`void`]]
  26. [[`make_void<int, int>::type`] [`void`]]
  27. ]
  28. [all_compilers] However, the type alias `void_t` is only available if the compiler supports template aliases.
  29. Further, in the absence of variadic-template support, `make_void` only supports up to 5 parameters.
  30. [endsect]