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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include <type_traits>
10
11struct Functor {
12 void operator()();
13};
14
15int func();
16
17struct NotFunctor {
18 bool compare();
19};
20
21struct ArgumentFunctor {
22 bool operator()(int, int);
23};
24
25static_assert(std::__is_callable<Functor>::value, "");
26static_assert(std::__is_callable<decltype(func)>::value, "");
27static_assert(!std::__is_callable<NotFunctor>::value, "");
28static_assert(!std::__is_callable<NotFunctor,
29 decltype(&NotFunctor::compare)>::value, "");
30static_assert(std::__is_callable<ArgumentFunctor, int, int>::value, "");
31static_assert(!std::__is_callable<ArgumentFunctor, int>::value, "");
32

source code of libcxx/test/libcxx/type_traits/is_callable.compile.pass.cpp