From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../function.objects/refwrap/unary.pass.cpp | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 test/std/utilities/function.objects/refwrap/unary.pass.cpp (limited to 'test/std/utilities/function.objects/refwrap/unary.pass.cpp') diff --git a/test/std/utilities/function.objects/refwrap/unary.pass.cpp b/test/std/utilities/function.objects/refwrap/unary.pass.cpp new file mode 100644 index 0000000000000..528a8f327d966 --- /dev/null +++ b/test/std/utilities/function.objects/refwrap/unary.pass.cpp @@ -0,0 +1,78 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// reference_wrapper + +// check for deriving from unary_function + +#include +#include + +class functor1 + : public std::unary_function +{ +}; + +class functor2 + : public std::binary_function +{ +}; + +class functor3 + : public std::unary_function, + public std::binary_function +{ +public: + typedef float result_type; +}; + +class functor4 + : public std::unary_function, + public std::binary_function +{ +public: +}; + +struct C +{ + typedef int argument_type; + typedef int result_type; +}; + +int main() +{ + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); +} -- cgit v1.2.3