From 94b2dd0998230c758abd92c99d3700c971f7a31a Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 22 Aug 2010 00:59:46 +0000 Subject: Fixing whitespace problems llvm-svn: 111767 --- .../function.objects/refwrap/binary.pass.cpp | 81 +++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp') diff --git a/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp b/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp index e9d7dda00a3..5c4c730ac6a 100644 --- a/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp +++ b/libcxx/test/utilities/function.objects/refwrap/binary.pass.cpp @@ -1 +1,80 @@ -//===----------------------------------------------------------------------===// // // 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), ""); } \ No newline at end of file +//===----------------------------------------------------------------------===// +// +// 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), ""); +} -- cgit v1.2.3