string ctor for pointer and literal because c++ semantics suck

master
Daniel Kolesa 2015-07-22 21:00:20 +01:00
parent 161ab5be85
commit 13ca140b63
1 changed files with 11 additions and 1 deletions

View File

@ -270,6 +270,16 @@ public:
p_len = v.size();
}
template<typename U>
StringBase(U v, const EnableIf<
IsConvertible<U, const Value *>::value && !IsArray<U>::value, A
> &a = A()): StringBase(ConstRange(v), a) {}
template<typename U, Size N>
StringBase(U (&v)[N], const EnableIf<
IsConvertible<U *, const Value *>::value, A
> &a = A()): StringBase(ConstRange(v), a) {}
template<typename R, typename = EnableIf<
IsInputRange<R>::value &&
IsConvertible<RangeReference<R>, Value>::value
@ -745,7 +755,7 @@ template<> struct ToString<bool> {
using Argument = bool;
using Result = String;
String operator()(bool b) {
return String(b ? "true" : "false");
return b ? "true" : "false";
}
};