-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
See conan-io/conan-center-index#23477
Caused by a problem related to MSVC. The compiler fix is only available in v143 and up. So we need making changes in our code.
Minimum code to reproduce
#include <type_traits>
template<class T, template<class...> class Template>
inline constexpr bool is_specialization_v = false;
template<template<class...> class Template, class... Types>
inline constexpr bool is_specialization_v<Template<Types...>, Template> = true;
template<class T, class U>
struct MyType
{
template<class Fn>
void Func(Fn&& f)
{
using RetType = std::remove_cvref_t<std::invoke_result_t<Fn>>;
static_assert(is_specialization_v<RetType, MyType>);
}
};
template<class U>
struct MyType<void, U>
{
template<class Fn>
void Func(Fn&& f)
{
using RetType = std::remove_cvref_t<std::invoke_result_t<Fn>>;
static_assert(is_specialization_v<RetType, MyType>);
}
};
template<class U>
struct MyType<double, U>
{
template<class Fn>
void Func(Fn&& f)
{
using RetType = std::remove_cvref_t<std::invoke_result_t<Fn>>;
static_assert(is_specialization_v<RetType, MyType>);
}
};
int main(int argc, char* argv[])
{
{
using T = MyType<int, int>;
T v;
v.Func([]() { return T {}; }); // #1 compiled
}
{
using T = MyType<void, int>;
T v;
v.Func([]() { return T {}; }); // #2 do not compiled
}
{
using T = MyType<double, int>;
T v;
v.Func([]() { return T {}; }); // #3 do not compiled
}
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working