実現したいこと
constexpr auto lambda = []<class T>() { return sizeof(T); };
constexpr auto binder = std::bind(lambda);
constexpr auto temp = std::invoke(binder);
テンプレートラムダ式を上記のような感じで呼び出したいのですが、可能でしょうか?
試したこと
constexpr auto lambda = [](auto obj) { return sizeof(obj); };
constexpr auto binder = std::bind(lambda, std::placeholders::_1);
constexpr auto temp = std::invoke(binder, 0);
auto型は↑で呼び出しが出来ました。
補足情報(FW/ツールのバージョンなど)
Visual Studio 2022 17.3.3
c++lasted

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/12/25 08:13