| //===----------------------------------------------------------------------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| // template <class F, class ...Args> |
| // result_of_t<F&&(Args&&...)> invoke(F&&, Args&&...); |
| # error Feature test macro should be defined |
| # ifndef __cpp_lib_invoke |
| # error Feature test macro not defined |
| # if __cpp_lib_invoke != 201411 |
| # error __cpp_lib_invoke has the wrong value |
| int foo(int) { return 42; } |
| #if defined(__cpp_lib_invoke) |
| assert(std::invoke(foo, 101) == 42); |