brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 3185de2 Raw
36 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <functional>10// REQUIRES: c++03 || c++11 || c++1411// binary_function was removed in C++1712 13// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS14 15// template <class Arg1, class Arg2, class Result>16// struct binary_function17// {18//     typedef Arg1   first_argument_type;19//     typedef Arg2   second_argument_type;20//     typedef Result result_type;21// };22 23#include <functional>24#include <type_traits>25 26#include "test_macros.h"27 28int main(int, char**)29{30    static_assert((std::is_same<std::binary_function<int, unsigned, char>::first_argument_type, int>::value), "");31    static_assert((std::is_same<std::binary_function<int, unsigned, char>::second_argument_type, unsigned>::value), "");32    static_assert((std::is_same<std::binary_function<int, unsigned, char>::result_type, char>::value), "");33 34  return 0;35}36