summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp
blob: 72a90b903f1de6a32e3f345f0008d216499ef43f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// negate

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::negate<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::unary_function<int, int>, F>::value), "");
    assert(f(36) == -36);
}
OpenPOWER on IntegriCloud