cpp-common/bt2c: add `format_as()` functions for `Uuid` and `UuidView`
[babeltrace.git] / src / cpp-common / bt2c / call.hpp
CommitLineData
557acf4c
PP
1/*
2 * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef BABELTRACE_CPP_COMMON_BT2C_CALL_HPP
8#define BABELTRACE_CPP_COMMON_BT2C_CALL_HPP
9
10#include <functional>
11#include <utility>
12
13namespace bt2c {
14
15/*
16 * Partial implementation of INVOKE.
17 *
18 * As found in
19 * <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0312r1.html>.
20 */
21template <typename FuncT, typename... ArgTs>
22auto call(FuncT func, ArgTs&&...args) -> decltype(std::ref(func)(std::forward<ArgTs>(args)...))
23{
24 return std::ref(func)(std::forward<ArgTs>(args)...);
25}
26
27} /* namespace bt2c */
28
29#endif /* BABELTRACE_CPP_COMMON_BT2C_CALL_HPP */
This page took 0.028187 seconds and 4 git commands to generate.