convenience ctor condition in Variant to build string from char literal

Because this is especially annoying when constructing any type
based on lib::Variant, which is assumed to hold a string.
This commit is contained in:
Fischlurch 2016-02-05 22:33:50 +01:00
parent 743a30c1ed
commit 20bdee4acc

View file

@ -128,6 +128,12 @@ namespace lib {
using Type = X;
};
template<typename TYPES, size_t len>
struct CanBuildFrom<const char [len], Node<string, TYPES>> ///< esp. allow to build string from char literal
{
using Type = string;
};
template<typename X, typename T,typename TYPES>
struct CanBuildFrom<X, Node<T, TYPES>>
{