1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00
Sprout/sprout/functional/invoke.hpp
2019-01-07 17:47:17 +09:00

31 lines
1.2 KiB
C++

/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2019 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_FUNCTIONAL_INVOKE_HPP
#define SPROUT_FUNCTIONAL_INVOKE_HPP
#include <sprout/config.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/type_traits/invoke_result.hpp>
#include <sprout/type_traits/is_nothrow_invocable.hpp>
#include <sprout/type_traits/detail/invoke.hpp>
namespace sprout {
//
// invoke
//
template<typename F, typename... Args>
inline SPROUT_CONSTEXPR typename sprout::invoke_result<F, Args...>::type
invoke(F&& f, Args&&... args) SPROUT_NOEXCEPT_IF((sprout::is_nothrow_invocable<F, Args...>::value)) {
return sprout::detail::invoke(SPROUT_FORWARD(F, f), SPROUT_FORWARD(Args, args)...);
}
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_INVOKE_HPP