Lets say I have an enum in a namespace with some helper functions:
namespace MyEnumNamespace
{
enum MyEnum
{
Foo,
Bar
};
MyEnum FromString(std::string);
}
And I have a deserialization function that I would like to specialize for all enums using SFINAE (assuming they all have the FromString
function defined).
template <typename T>
std::enable_if_t<std::is_enum_v<T>, T> Deserialize(const MyVariant& variant)
{
return FromString(variant.AsString());
}
How would I call FromString
without knowing the name of the namespace? All I know is that T
is in the same namespace as FromString
.