Skip to content

Commit

Permalink
Update remaining getters to constref return
Browse files Browse the repository at this point in the history
  • Loading branch information
cbachhuber committed Dec 3, 2019
1 parent 56b30f4 commit 14c02b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/CLI/Option.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class Option : public OptionBase<Option> {
int get_type_size_max() const { return type_size_max_; }

/// The environment variable associated to this value
std::string get_envname() const { return envname_; }
const std::string &get_envname() const { return envname_; }

/// The set of options needed
std::set<Option *> get_needs() const { return needs_; }
Expand All @@ -654,13 +654,13 @@ class Option : public OptionBase<Option> {

/// The default value (for help printing) DEPRECATED Use get_default_str() instead
CLI11_DEPRECATED("Use get_default_str() instead")
std::string get_defaultval() const { return default_str_; }
const std::string &get_defaultval() const { return default_str_; }

/// The default value (for help printing)
std::string get_default_str() const { return default_str_; }
const std::string &get_default_str() const { return default_str_; }

/// Get the callback function
callback_t get_callback() const { return callback_; }
const callback_t &get_callback() const { return callback_; }

/// Get the long names
const std::vector<std::string> &get_lnames() const { return lnames_; }
Expand All @@ -669,7 +669,7 @@ class Option : public OptionBase<Option> {
const std::vector<std::string> &get_snames() const { return snames_; }

/// Get the flag names with specified default values
std::vector<std::string> get_fnames() const { return fnames_; }
const std::vector<std::string> &get_fnames() const { return fnames_; }

/// The number of times the option expects to be included
int get_expected() const { return expected_min_; }
Expand Down

0 comments on commit 14c02b7

Please sign in to comment.