Skip to content
Snippets Groups Projects
Commit 7ccd5ae9 authored by Martin Nolte's avatar Martin Nolte
Browse files

Merge branch 'cherry-pick-683d8741' into 'releases/2.6'

Merge branch 'feature/is_invocable' into 'master'

See merge request core/dune-common!401
parents 6f45ff9d e127e4d6
No related branches found
No related tags found
4 merge requests!586Centralize CI config for 2.6 release,!531Update CI for 2.6 release branch,!407[bugfix,2.6] Fix CMake with deactivated compiler version check,!401Merge branch 'feature/is_invocable' into 'master'
Pipeline #
......@@ -193,6 +193,45 @@ namespace Std
{};
/**
* \brief Traits class to check if function is invocable
*
* \tparam F Function to check
* \tparam Args Function arguments to check
*
* This checks if F can be called with an arguments list of type Args....
* The result is encoded by deriving from std::ingegral_constant<bool, result>.
*
* This implements std::is_invocable from C++17.
*
* \ingroup CxxUtilities
*/
template <class F, class... Args>
struct is_invocable :
decltype(Impl::is_callable_helper<void, F, Args...>(PriorityTag<42>()))
{};
/**
* \brief Traits class to check if function is invocable and the return type is compatible
*
* \tparam R Desired result type
* \tparam F Function to check
* \tparam Args Function arguments to check
*
* This checks if F can be called with an arguments list of type Args..., and
* if the return value can be converted to R.
* The result is encoded by deriving from std::ingegral_constant<bool, result>.
*
* This implements std::is_invocable_r from C++17.
*
* \ingroup CxxUtilities
*/
template <class R, class F, class... Args>
struct is_invocable_r :
decltype(Impl::is_callable_helper<R, F, Args...>(PriorityTag<42>()))
{};
#if DUNE_HAVE_CXX_EXPERIMENTAL_IS_DETECTED
using std::experimental::nonesuch;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment