base: Make Named::name() non-reference
Some of the use cases for name() inheritance may use local strings, which complicates the use of rvalues. Change-Id: I22188a238dbe73a5f174f70b88bc4b8812f9d31a Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43588 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Daniel Carvalho
parent
ad5ae10c8e
commit
bac49a04b5
@@ -41,7 +41,7 @@ class Named
|
||||
Named(const std::string &name_) : _name(name_) { }
|
||||
virtual ~Named() = default;
|
||||
|
||||
virtual const std::string &name() const { return _name; }
|
||||
virtual std::string name() const { return _name; }
|
||||
};
|
||||
|
||||
#endif // __BASE_NAMED_HH__
|
||||
|
||||
Reference in New Issue
Block a user