Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <type_traits>
7 :
8 : #include "Utilities/TypeTraits/CreateIsCallable.hpp"
9 :
10 : namespace db::detail {
11 : CREATE_IS_CALLABLE(apply)
12 : CREATE_IS_CALLABLE_V(apply)
13 :
14 : template <typename Func, typename... Args>
15 : constexpr void error_function_not_callable() {
16 : static_assert(
17 : std::is_same_v<Func, void>,
18 : "The function is not callable with the expected arguments. "
19 : "See the first template parameter of "
20 : "error_function_not_callable for the function or object type and "
21 : "the remaining arguments for the parameters that cannot be "
22 : "passed. If all the argument types match, it could be that you "
23 : "have a template parameter that cannot be deduced."
24 : "Note that for most DataBox functions, you must pass either "
25 : "a function pointer, a lambda, or a class with a call operator "
26 : "or static apply function, and this error will also arise if "
27 : "the provided entity does not satisfy that requirement (e.g. "
28 : "if the provided class defines a function with the incorrect name).");
29 : }
30 : } // namespace db::detail
|