void.cpp 692 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. Copyright Barrett Adair 2016-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. */
  6. #include <type_traits>
  7. #include <functional>
  8. #include <tuple>
  9. #include <boost/callable_traits.hpp>
  10. struct foo {
  11. void operator()() const {}
  12. };
  13. namespace ct = boost::callable_traits;
  14. int main() {
  15. using args = ct::args_t<foo>;
  16. using expected_args = std::tuple<>;
  17. static_assert(std::is_same<args, expected_args>{}, "");
  18. using signature = ct::function_type_t<foo>;
  19. using expected_signature = void();
  20. static_assert(std::is_same<signature, expected_signature>{}, "");
  21. return 0;
  22. }