summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/arithmetic.operations/negate.pass.cpp
blob: 6c6957ab1e7304e5fa1a6cb874628a6151322733 (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 dual licensed under the MIT and the University of Illinois Open
// Source Licenses. 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