has_varargs.cpp 572 B

123456789101112131415161718192021222324
  1. /*<-
  2. Copyright (c) 2016 Barrett Adair
  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. #ifdef BOOST_CLBL_TRTS_MSVC
  7. // MSVC requires __cdecl for varargs, and I don't want to clutter the example
  8. int main(){}
  9. #else
  10. //[ has_varargs
  11. #include <type_traits>
  12. #include <boost/callable_traits/has_varargs.hpp>
  13. namespace ct = boost::callable_traits;
  14. static_assert(ct::has_varargs<int(...)>::value, "");
  15. static_assert(!ct::has_varargs<int()>::value, "");
  16. int main() {}
  17. //]
  18. #endif