//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // reference_wrapper // check for deriving from binary_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), ""); static_assert((std::is_base_of, std::reference_wrapper >::value), ""); }