//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <functional>
// reference_wrapper
// check for deriving from binary_function
#include<functional>#include<type_traits>classfunctor1:publicstd::unary_function<int,char>{};classfunctor2:publicstd::binary_function<char,int,double>{};classfunctor3:publicstd::unary_function<int,int>,publicstd::binary_function<char,int,double>{public:typedeffloatresult_type;};classfunctor4:publicstd::unary_function<int,int>,publicstd::binary_function<char,int,double>{public:};structC{typedefintargument_type;typedefintresult_type;};intmain(){static_assert((!std::is_base_of<std::binary_function<int,char,int>,std::reference_wrapper<functor1>>::value),"");static_assert((std::is_base_of<std::binary_function<char,int,double>,std::reference_wrapper<functor2>>::value),"");static_assert((std::is_base_of<std::binary_function<char,int,double>,std::reference_wrapper<functor3>>::value),"");static_assert((std::is_base_of<std::binary_function<char,int,double>,std::reference_wrapper<functor4>>::value),"");static_assert((!std::is_base_of<std::binary_function<int,int,int>,std::reference_wrapper<C>>::value),"");static_assert((!std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float()>>::value),"");static_assert((!std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float(int)>>::value),"");static_assert((std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float(int,int)>>::value),"");static_assert((!std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float(*)()>>::value),"");static_assert((!std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float(*)(int)>>::value),"");static_assert((std::is_base_of<std::binary_function<int,int,float>,std::reference_wrapper<float(*)(int,int)>>::value),"");static_assert((!std::is_base_of<std::binary_function<C*,int,float>,std::reference_wrapper<float(C::*)()>>::value),"");static_assert((std::is_base_of<std::binary_function<C*,int,float>,std::reference_wrapper<float(C::*)(int)>>::value),"");static_assert((std::is_base_of<std::binary_function<constvolatileC*,int,float>,std::reference_wrapper<float(C::*)(int)constvolatile>>::value),"");}