jiridanek commented on a change in pull request #303:
URL: https://github.com/apache/qpid-proton/pull/303#discussion_r612972817
##########
File path: cpp/src/url.cpp
##########
@@ -274,14 +274,10 @@ std::string to_string(const url& u) {
std::istream& operator>>(std::istream& i, url& u) {
std::string s;
i >> s;
- if (!i.fail() && !i.bad()) {
- if (!s.empty()) {
- url::impl* p = new url::impl(s);
- p->defaults();
- u.impl_.reset(p);
- } else {
- i.clear(std::ios::failbit);
- }
+ if (!i.fail()) {
Review comment:
> It has the same meaning as `!i.fail() && !i.bad()`
It does, but never mind that. `fail()` also checks the badbit, as shown in
the colorful table at https://en.cppreference.com/w/cpp/io/basic_ios/fail. so
what you have there now is probably best.
> it should be possible to eof and s.empty() but !fail && !bad
@DreamPearl could you investigate this more? I myself think it is not
possible, but we need to be sure about this, before we make the change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]