Skip to content

Commit

Permalink
Use member initializer list to SizeRange ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
hokacci committed Sep 15, 2021
1 parent bec93ac commit 14abaa4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,9 @@ class SizeRange {
std::size_t mMax;

public:
SizeRange(std::size_t aMin, std::size_t aMax) {
SizeRange(std::size_t aMin, std::size_t aMax) : mMin(aMin), mMax(aMax) {
if (aMin > aMax)
throw std::logic_error("Range of number of arguments is invalid");
mMin = aMin;
mMax = aMax;
}

bool contains(std::size_t value) const {
Expand Down

0 comments on commit 14abaa4

Please sign in to comment.