Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Mar 16, 2024
1 parent 3268de7 commit a27a526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Siv3D/include/Siv3D/AsyncTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace s3d
/// @remark 参照を渡す場合は `std::ref()` を使ってください。
template <class Fty, class... Args>
[[nodiscard]]
explicit AsyncTask(Fty&& f, Args&&... args) requires std::invocable<Fty, Args...>;
explicit AsyncTask(Fty&& f, Args&&... args) requires std::invocable<std::decay_t<Fty>, std::decay_t<Args>...>;

AsyncTask(const base_type&) = delete;

Expand Down Expand Up @@ -153,7 +153,7 @@ namespace s3d
base_type m_data;
};

template <class Fty, class... Args> requires std::invocable<Fty, Args...>
template <class Fty, class... Args> requires std::invocable<std::decay_t<Fty>, std::decay_t<Args>...>
AsyncTask(Fty, Args...) -> AsyncTask<std::invoke_result_t<std::decay_t<Fty>, std::decay_t<Args>...>>;

////////////////////////////////////////////////////////////////
Expand All @@ -170,7 +170,7 @@ namespace s3d
/// @remark 作成と同時にタスクが非同期で実行されます。
/// @remark 参照を渡す場合は `std::ref()` を使ってください。
/// @return 作成された非同期処理のタスク
template <class Fty, class... Args> requires std::invocable<Fty, Args...>
template <class Fty, class... Args> requires std::invocable<std::decay_t<Fty>, std::decay_t<Args>...>
[[nodiscard]]
auto Async(Fty&& f, Args&&... args);
}
Expand Down
4 changes: 2 additions & 2 deletions Siv3D/include/Siv3D/detail/AsyncTask.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace s3d

template <class Type>
template <class Fty, class... Args>
AsyncTask<Type>::AsyncTask(Fty&& f, Args&&... args) requires std::invocable<Fty, Args...>
AsyncTask<Type>::AsyncTask(Fty&& f, Args&&... args) requires std::invocable<std::decay_t<Fty>, std::decay_t<Args>...>
# if !SIV3D_PLATFORM(WEB) || defined(__EMSCRIPTEN_PTHREADS__)
: m_data{ std::async(std::launch::async, std::forward<Fty>(f), std::forward<Args>(args)...) } {}
# else
Expand Down Expand Up @@ -148,7 +148,7 @@ namespace s3d
//
////////////////////////////////////////////////////////////////

template <class Fty, class... Args> requires std::invocable<Fty, Args...>
template <class Fty, class... Args> requires std::invocable<std::decay_t<Fty>, std::decay_t<Args>...>
auto Async(Fty&& f, Args&&... args)
{
return AsyncTask<std::invoke_result_t<std::decay_t<Fty>, std::decay_t<Args>...>>{ std::forward<Fty>(f), std::forward<Args>(args)... };
Expand Down

0 comments on commit a27a526

Please sign in to comment.