From 3fa3d33908f630b2aa16077e5cd1199285b5c144 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Mon, 3 Nov 2014 15:53:18 +0100 Subject: [PATCH] Let's return encoding and source by reference and move all the variables with the move constructor --- include/template.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/template.h b/include/template.h index a5976db..50ffa05 100644 --- a/include/template.h +++ b/include/template.h @@ -68,10 +68,12 @@ class Template /** * Move constructor + * @param that */ Template(Template &&that) : _executor(that._executor), - _encoding(std::move(that._encoding)) { + _encoding(std::move(that._encoding)), + _source(std::move(that._source)) { that._executor = nullptr; } @@ -143,12 +145,12 @@ class Template /** * Used to retrieve what encoding this template is in, natively */ - const std::string encoding() const { return _encoding; }; + const std::string &encoding() const { return _encoding; }; /** * Retrieve the original source of this template */ - const std::string source() const { return _source; }; + const std::string &source() const { return _source; }; }; /**