summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
blob: ade0f91c1d7250675c515f57bf4c4ce8ea06f31f (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>

// modulus

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

int main()
{
    typedef std::modulus<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(36, 8) == 4);
}
OpenPOWER on IntegriCloud