add move c'tor to Header

This commit is contained in:
Dennis Luxen 2014-06-09 17:57:03 +02:00
parent 15f62e680a
commit 56cdabff6a

View File

@ -29,18 +29,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define HTTP_HEADER_H #define HTTP_HEADER_H
#include <string> #include <string>
#include <algorithm>
namespace http namespace http
{ {
struct Header struct Header
{ {
std::string name; Header& operator=(const Header& other) = default;
std::string value; Header(const std::string & name, const std::string & value) : name(name), value(value) {}
Header(const Header && other) : name(std::move(other.name)), value(std::move(other.value)) {}
void Clear() void Clear()
{ {
name.clear(); name.clear();
value.clear(); value.clear();
} }
std::string name;
std::string value;
}; };
} }