summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/callable_traits/example/has_varargs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/callable_traits/example/has_varargs.cpp')
-rw-r--r--src/boost/libs/callable_traits/example/has_varargs.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/boost/libs/callable_traits/example/has_varargs.cpp b/src/boost/libs/callable_traits/example/has_varargs.cpp
new file mode 100644
index 000000000..1dd66fd44
--- /dev/null
+++ b/src/boost/libs/callable_traits/example/has_varargs.cpp
@@ -0,0 +1,24 @@
+/*<-
+Copyright (c) 2016 Barrett Adair
+
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
+->*/
+
+#ifdef BOOST_CLBL_TRTS_MSVC
+// MSVC requires __cdecl for varargs, and I don't want to clutter the example
+int main(){}
+#else
+
+//[ has_varargs
+#include <type_traits>
+#include <boost/callable_traits/has_varargs.hpp>
+
+namespace ct = boost::callable_traits;
+
+static_assert(ct::has_varargs<int(...)>::value, "");
+static_assert(!ct::has_varargs<int()>::value, "");
+
+int main() {}
+//]
+#endif