Return argument parents by reference

This commit is contained in:
Martchus 2019-06-04 19:08:46 +02:00
parent bfdd6ada2b
commit 6d2544b908
1 changed files with 2 additions and 4 deletions

View File

@ -319,7 +319,7 @@ public:
void setSubArguments(const ArgumentInitializerList &subArguments);
void addSubArgument(Argument *arg);
bool hasSubArguments() const;
const ArgumentVector parents() const;
const ArgumentVector &parents() const;
void printInfo(std::ostream &os, unsigned char indentation = 0) const;
// declare getter/setter/properties for bash completion: those properties must be set *before parsing
@ -979,10 +979,8 @@ inline bool Argument::hasSubArguments() const
*
* If this argument is used as a main argument shouldn't be used as
* secondary argument at the same time and thus have no parents.
*
* \todo Return by reference in v5.
*/
inline const ArgumentVector Argument::parents() const
inline const ArgumentVector &Argument::parents() const
{
return m_parents;
}