Path: blob/main/contrib/llvm-project/libcxx/include/__concepts/invocable.h
35262 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___CONCEPTS_INVOCABLE_H9#define _LIBCPP___CONCEPTS_INVOCABLE_H1011#include <__config>12#include <__functional/invoke.h>13#include <__utility/forward.h>1415#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif1819_LIBCPP_BEGIN_NAMESPACE_STD2021#if _LIBCPP_STD_VER >= 202223// [concept.invocable]2425template <class _Fn, class... _Args>26concept invocable = requires(_Fn&& __fn, _Args&&... __args) {27std::invoke(std::forward<_Fn>(__fn), std::forward<_Args>(__args)...); // not required to be equality preserving28};2930// [concept.regular.invocable]3132template <class _Fn, class... _Args>33concept regular_invocable = invocable<_Fn, _Args...>;3435#endif // _LIBCPP_STD_VER >= 203637_LIBCPP_END_NAMESPACE_STD3839#endif // _LIBCPP___CONCEPTS_INVOCABLE_H404142