Add convenience ntstring::operator=(const char (&)[N])

OS X-specific configuration code assumes the ability to assign a literal
string to an ntstring.  Add an operator= overload to support that.

Reported by kreatordxx: https://github.com/dxx-rebirth/dxx-rebirth/issues/30
This commit is contained in:
Kp 2015-01-11 18:19:13 +00:00
parent 3ad422a4be
commit f0b47829ef

View file

@ -84,4 +84,11 @@ public:
{
return !(*this == r);
}
template <std::size_t N>
ntstring &operator=(const char (&i)[N])
{
static_assert(N <= L, "string too long");
copy_if(i);
return *this;
}
};