15#ifndef dealii_base_mutable_bind_h
16#define dealii_base_mutable_bind_h
79 template <
typename ReturnType,
class... FunctionArgs>
88 std::tuple<std::remove_cv_t<std::remove_reference_t<FunctionArgs>>...>;
94 template <
typename FunctionType>
101 template <
typename FunctionType>
108 template <
typename FunctionType>
154 const std::function<ReturnType(FunctionArgs...)>
function;
184 template <
typename ReturnType,
class... FunctionArgs>
192 template <
typename ReturnType,
class... FunctionArgs>
207 template <
typename ReturnType,
class... FunctionArgs>
214 template <
typename ReturnType,
class... FunctionArgs>
221 template <
typename ReturnType,
class... FunctionArgs>
222 template <
typename FunctionType>
224 FunctionType function,
225 FunctionArgs &&...arguments)
227 , arguments(
std::make_tuple(
std::move(arguments)...))
232 template <
typename ReturnType,
class... FunctionArgs>
233 template <
typename FunctionType>
234 MutableBind<ReturnType, FunctionArgs...>::MutableBind(FunctionType function,
235 TupleType &&arguments)
237 , arguments(
std::move(arguments))
242 template <
typename ReturnType,
class... FunctionArgs>
243 template <
typename FunctionType>
244 MutableBind<ReturnType, FunctionArgs...>::MutableBind(FunctionType function)
250 template <
typename ReturnType,
class... FunctionArgs>
252 MutableBind<ReturnType, FunctionArgs...>::operator()()
const
254 return std::apply(function, arguments);
259 template <
typename ReturnType,
class... FunctionArgs>
261 MutableBind<ReturnType, FunctionArgs...>::set_arguments(
262 FunctionArgs &&...args)
264 arguments = std::make_tuple(std::move(args)...);
269 template <
typename ReturnType,
class... FunctionArgs>
271 MutableBind<ReturnType, FunctionArgs...>::set_arguments(TupleType &&args)
273 arguments = std::move(args);
278 template <
typename ReturnType,
class... FunctionArgs>
280 MutableBind<ReturnType, FunctionArgs...>::parse_arguments(
281 const std::string &value_string,
290 template <
typename ReturnType,
class... FunctionArgs>
291 MutableBind<ReturnType, FunctionArgs...>
295 return MutableBind<ReturnType, FunctionArgs...>(function,
296 std::move(arguments)...);
301 template <
typename ReturnType,
class... FunctionArgs>
302 MutableBind<ReturnType, FunctionArgs...>
305 return MutableBind<ReturnType, FunctionArgs...>(function);
310 template <
typename ReturnType,
class... FunctionArgs>
311 MutableBind<ReturnType, FunctionArgs...>
312 mutable_bind(std::function<ReturnType(FunctionArgs...)> function,
315 return MutableBind<ReturnType, FunctionArgs...>(function,
316 std::move(arguments)...);
321 template <
typename ReturnType,
class... FunctionArgs>
322 MutableBind<ReturnType, FunctionArgs...>
323 mutable_bind(std::function<ReturnType(FunctionArgs...)> function)
325 return MutableBind<ReturnType, FunctionArgs...>(function);
ReturnType operator()() const
MutableBind(FunctionType function)
void set_arguments(FunctionArgs &&...arguments)
MutableBind(FunctionType function, TupleType &&arguments)
const std::function< ReturnType(FunctionArgs...)> function
void set_arguments(TupleType &&arguments)
MutableBind(FunctionType function, FunctionArgs &&...arguments)
void parse_arguments(const std::string &value_string, const Patterns::PatternBase &pattern= *Patterns::Tools::Convert< TupleType >::to_pattern())
std::tuple< std::remove_cv_t< std::remove_reference_t< FunctionArgs > >... > TupleType
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
MutableBind< ReturnType, FunctionArgs... > mutable_bind(ReturnType(*function)(FunctionArgs...), std_cxx20::type_identity_t< FunctionArgs > &&...arguments)
typename type_identity< T >::type type_identity_t