Warning, file /graphics/glaxnimate/src/core/model/invoke.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include <tuple>
0010 
0011 namespace glaxnimate::model::detail {
0012 
0013 
0014 template<class FuncT, class... Args, std::size_t... I>
0015 auto invoke_impl(const FuncT& fun, std::index_sequence<I...>, const std::tuple<Args...>& args)
0016 {
0017   return fun(std::get<I>(args)...);
0018 }
0019 
0020 template<int ArgCount, class FuncT, class... Args>
0021 auto invoke(const FuncT& fun, const Args&... t)
0022 {
0023   return invoke_impl(fun, std::make_index_sequence<ArgCount>(), std::make_tuple(t...));
0024 }
0025 
0026 } // namespace glaxnimate::model::detail