Skip to content

Commit

Permalink
Fix 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 de76983 commit cd7dae2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/CLI/Option.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class Option : public OptionBase<Option> {
}

/// Adds a Validator. Takes a const string& and returns an error message (empty if conversion/check is okay).
Option *check(const std::function<std::string(const std::string &)> &Validator,
Option *check(std::function<std::string(const std::string &)> Validator,
std::string Validator_description = "",
std::string Validator_name = "") {
validators_.emplace_back(Validator, std::move(Validator_description), std::move(Validator_name));
Expand Down Expand Up @@ -663,10 +663,10 @@ class Option : public OptionBase<Option> {
callback_t get_callback() const { return callback_; }

/// Get the long names
std::vector<std::string> get_lnames() const { return lnames_; }
const std::vector<std::string> &get_lnames() const { return lnames_; }

/// Get the short names
std::vector<std::string> get_snames() const { return snames_; }
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_; }
Expand Down

0 comments on commit cd7dae2

Please sign in to comment.