Loading...
Searching...
No Matches
Dune::IsCallable< D, R > Struct Template Reference
Common » Utilities » C++ utilities and backports

Check if a type is callable with ()-operator and given arguments. More...

Inheritance diagram for Dune::IsCallable< D, R >:

## Detailed Description

template<typename D, typename R = void>
struct Dune::IsCallable< D, R >

Check if a type is callable with ()-operator and given arguments.

Template Parameters

  D | Function descriptor
  R | Return value type

If D = F(Args...) this checks if F can be called with an argument list of type Args..., and if the return value can be converted to R. If R is void, any return type is accepted.

The result is encoded by deriving from either std::true_type or std::false_type

If D is not of the form F(Args...) this class is not defined.

Note
  This differs from std::invocable_r in the way that only FunctionObject types are allowed here while std::invocable_r also accepts pointers to member functions and pointers to data members (i.e. more general Callable types)
  See https://en.cppreference.com/w/cpp/named_req/FunctionObject for the description of the named requirement FunctionObject and https://en.cppreference.com/w/cpp/named_req/Callable for Callable.

The documentation for this struct was generated from the following file:

- typetraits.hh