I'm sure someone else can provide a more comprehensive answer than I could, Just a few things:
string::at
throws anout-of-range
exception, since you're not actually catching anywhere, I'd use[]
sinceat()
is slower slower and you're already checking the string length, not that it really matters that much for this simple code though.I would factor out the
std::wstring(argv[1])
and similar into local variables so there are fewer brackets.if statements without braces are less maintainable less maintainable.
wmain is windows specific, so this code won't compile elsewhere.
I'm sure someone else can provide a more comprehensive answer than I could, Just a few things:
string::at
throws anout-of-range
exception, since you're not actually catching anywhere, I'd use[]
sinceat()
is slower and you're already checking the string length, not that it really matters that much for this simple code though.I would factor out the
std::wstring(argv[1])
and similar into local variables so there are fewer brackets.if statements without braces are less maintainable.
wmain is windows specific, so this code won't compile elsewhere.
I'm sure someone else can provide a more comprehensive answer than I could, Just a few things:
string::at
throws anout-of-range
exception, since you're not actually catching anywhere, I'd use[]
sinceat()
is slower and you're already checking the string length, not that it really matters that much for this simple code though.I would factor out the
std::wstring(argv[1])
and similar into local variables so there are fewer brackets.if statements without braces are less maintainable.
wmain is windows specific, so this code won't compile elsewhere.
I'm sure someone else can provide a more comprehensive answer than I could, Just a few things:
string::at
throws anout-of-range
exception, since you're not actually catching anywhere, I'd use[]
sinceat()
is slower and you're already checking the string length, not that it really matters that much for this simple code though.I would factor out the
std::wstring(argv[1])
and similar into local variables so there are fewer brackets.if statements without braces are less maintainable.
wmain is windows specific, so this code won't compile elsewhere.