u01: Accept reference for node::set_name
This harmonizes the signatures of set_name and the constructor.filtered
parent
63431b6824
commit
60a8abfe34
|
@ -29,7 +29,7 @@ node::~node() {
|
||||||
|
|
||||||
std::string node::get_name() const { return name; }
|
std::string node::get_name() const { return name; }
|
||||||
|
|
||||||
void node::set_name(const std::string new_name) { this->name = new_name; }
|
void node::set_name(const std::string& new_name) { this->name = new_name; }
|
||||||
|
|
||||||
std::size_t node::get_nr_children() const { return children.size(); }
|
std::size_t node::get_nr_children() const { return children.size(); }
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ public:
|
||||||
node(const std::string &name = "");
|
node(const std::string &name = "");
|
||||||
virtual ~node();
|
virtual ~node();
|
||||||
std::string get_name() const;
|
std::string get_name() const;
|
||||||
void set_name(const std::string new_name);
|
void set_name(const std::string &new_name);
|
||||||
std::size_t get_nr_children() const;
|
std::size_t get_nr_children() const;
|
||||||
node *get_child(std::size_t i) const;
|
node *get_child(std::size_t i) const;
|
||||||
void add_child(node *child);
|
void add_child(node *child);
|
||||||
|
|
Reference in New Issue