You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
458 B

#pragma once
#include <variant>
namespace internal
{
template<class T1, class... T, class... Vargs> bool InitV1(std::variant<Vargs...>& v, const michlib::MString& n)
{
if(T1::name != n)
{
if constexpr(sizeof...(T) > 0)
return InitV1<T...>(v, n);
else
return false;
}
v = T1();
return true;
}
template<class... Vargs> bool InitV(std::variant<Vargs...>& v, const michlib::MString& n) { return InitV1<Vargs...>(v, n); }
} // namespace internal