/* @Copyright Barrett Adair 2015-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_CLBL_TRTS_HAS_VARARGS_HPP #define BOOST_CLBL_TRTS_HAS_VARARGS_HPP #include namespace boost { namespace callable_traits { //[ has_varargs_hpp /*`[section:ref_has_varargs has_varargs] [heading Header] ``#include `` [heading Definition] */ // inherits from either std::true_type or std::false_type template struct has_varargs; //<- template struct has_varargs : detail::traits< detail::shallow_decay>::has_varargs { using type = typename detail::traits< detail::shallow_decay>::has_varargs; }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template struct has_varargs_v { static_assert(std::is_same::value, "Variable templates not supported on this compiler."); }; #else //-> // only available when variable templates are supported template //<- BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool has_varargs_v = //see below //<- detail::traits>::has_varargs::value; #endif }} // namespace boost::callable_traits //-> /*` [heading Constraints] * none [heading Behavior] * `std::false_type` is inherited by `has_varargs` and is aliased by `typename has_varargs::type`, except when one of the following criteria is met, in which case `std::true_type` would be similarly inherited and aliased: * `T` is a function, function pointer, or function reference where the function's parameter list includes C-style variadics. * `T` is a pointer to a member function with C-style variadics in the parameter list. * `T` is a function object with a non-overloaded `operator()`, which has C-style variadics in the parameter list of its `operator()`. * On compilers that support variable templates, `has_varargs_v` is equivalent to `has_varargs::value`. [heading Input/Output Examples] [table [[`T`] [`has_varargs_v`]] [[`void(...)`] [`true`]] [[`void(int, ...) const`] [`true`]] [[`void(* volatile)(...)`] [`true`]] [[`void(&)(...)`] [`true`]] [[`void(foo::*)(...) const`] [`true`]] [[`void(*)()`] [`false`]] [[`void(*&)()`] [`false`]] [[`int`] [`false`]] [[`const int`] [`false`]] [[`int foo::*`] [`false`]] ] [heading Example Program] [import ../example/has_varargs.cpp] [has_varargs] [endsect] */ //] #endif