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:
parent
743a30c1ed
commit
20bdee4acc
1 changed files with 6 additions and 0 deletions
|
|
@ -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>>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue