From 20bdee4acc1125f8aee78fff61c0919d5414e003 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 5 Feb 2016 22:33:50 +0100 Subject: [PATCH] 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. --- src/lib/variant.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index d23ba8c50..66d990384 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -128,6 +128,12 @@ namespace lib { using Type = X; }; + template + struct CanBuildFrom> ///< esp. allow to build string from char literal + { + using Type = string; + }; + template struct CanBuildFrom> {