X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Fformat.cpp;h=d2065e91cad058cd74f63fa5a34dcec45f258cde;hp=1b8b4650a9efc852e2ab42268c775d7f5cb858f1;hb=f24e7b96e76b63c9b9b8a6bce4c7a9db64276ea8;hpb=1f0843257065789231a9949e0a81b79afd7bbebe diff --git a/source/strings/format.cpp b/source/strings/format.cpp index 1b8b465..d2065e9 100644 --- a/source/strings/format.cpp +++ b/source/strings/format.cpp @@ -11,6 +11,20 @@ Formatter::Formatter(const string &f): advance(); } +Formatter::Formatter(const Formatter &other): + fmt(other.fmt), + pos(fmt.begin()+(other.pos-other.fmt.begin())), + result(other.result) +{ } + +Formatter &Formatter::operator=(const Formatter &other) +{ + fmt = other.fmt; + pos = fmt.begin()+(other.pos-other.fmt.begin()); + result = other.result; + return *this; +} + const string &Formatter::str() const { if(pos!=fmt.end()) @@ -41,7 +55,7 @@ Fmt Formatter::get_conversion() if(pos==fmt.end()) throw format_error("Too many arguments for format"); - string::iterator i = pos; + auto i = pos; for(; i!=fmt.end(); ++i) if(isalpha(*i)) break;