Siv3D / OpenSiv3D

C++20 framework for creative coding 🎮🎨🎹 / Cross-platform support (Windows, macOS, Linux, and the Web)
https://siv3d.github.io/
MIT License
994 stars 136 forks source link

AsyncTask 関連のテンプレートパラメータ制約を修正 #1213

Closed Raclamusi closed 5 months ago

Raclamusi commented 5 months ago

AsyncTask のコンストラクタテンプレートや推論補助、ヘルパ関数テンプレートのテンプレートパラメータ制約に std::decay_t がついておらず、オーバーロード解決に失敗することがあったので、修正しました。

失敗するコード

# include <Siv3D.hpp> // OpenSiv3D v0.6.14

struct Func
{
    int32 operator()(int32 x) const
    {
        return 0;
    }

    int64 operator()(int32& x) const
    {
        return 0;
    }
};

void Main()
{
    int32 x = 0;
    AsyncTask task(Func{}, x);
}
Reputeless commented 5 months ago

Merged. Goog catch! siv8 にも反映させておきます。