Skip to content

Commit

Permalink
Let's return encoding and source by reference and move all the variab…
Browse files Browse the repository at this point in the history
…les with the move constructor
  • Loading branch information
Toon Schoenmakers committed Nov 3, 2014
1 parent d4e42e0 commit 3fa3d33
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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; };
};

/**
Expand Down

0 comments on commit 3fa3d33

Please sign in to comment.