Change C4ID constructors so string literals warn

stable-5.1
Benjamin Herr 2010-03-22 15:27:39 +01:00
parent bc58aae0ff
commit b600fab6b8
2 changed files with 3 additions and 4 deletions

View File

@ -58,8 +58,6 @@ const C4ID C4ID::Rivalry("RVLR");
#endif
C4ID::C4ID(const std::string &s) { assign(s); }
C4ID::C4ID(const char *s) { assign(s); }
C4ID::C4ID(char *s) { assign(s); }
void C4ID::assign(const std::string &s)
{

View File

@ -70,8 +70,9 @@ public:
C4ID &operator =(const C4ID &other) { v = other.v; return *this; }
explicit C4ID(const std::string &s);
explicit C4ID(char *s);
DEPRECATED explicit C4ID(const char *s); // Only difference is deprecation; const char should get all inline constants, but not stuff ead into variables
template<size_t N>
DEPRECATED explicit C4ID(const char (&s)[N]) { assign(s); }
explicit inline C4ID(Handle i): v(i)
{
assert(v < names.size());