//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // REQUIRES: c++03 || c++11 || c++14 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS // // reference_wrapper // check for deriving from unary_function #include #include #include "test_macros.h" 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(int, char**) { 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), ""); return 0; }