From 6d2544b908b73774ac7469733d44f5d9322b1e84 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 4 Jun 2019 19:08:46 +0200 Subject: [PATCH] Return argument parents by reference --- application/argumentparser.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application/argumentparser.h b/application/argumentparser.h index d41156b..91ff19d 100644 --- a/application/argumentparser.h +++ b/application/argumentparser.h @@ -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; }