Skip to content

request_value_semantics test failed #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix swap and equals methods of http::request
  • Loading branch information
nico159 committed May 18, 2013
commit 90ab5bc2a486f1b859ef3023755546bd2bf58f9e
5 changes: 2 additions & 3 deletions http/src/network/protocol/http/request/request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ struct request : request_base {
request(request const&);
request& operator=(request);

// Then we lift the swap and equals implementation.
using request_base::swap;
using request_base::equals;
virtual void swap(request& other);
virtual bool equals(request const& other) const;

// From message_base...
// Mutators
Expand Down
9 changes: 9 additions & 0 deletions http/src/network/protocol/http/request/request.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ request& request::operator=(request rhs) {
return *this;
}

void request::swap(request& other ) {
std::swap(pimpl_, other.pimpl_);
request_storage_base::swap(other);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost, but not quite. It should probably look like this:

using std::swap;
swap(pimpl_, other.pimpl_);
request_storage_base::swap(other);

}

bool request::equals(request const& other) const {
return pimpl_->equals(*other.pimpl_) && request_storage_base::equals(other);
}

// From message_base...
// Mutators
void request::set_destination(std::string const& destination) {
Expand Down