-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add operator * and operator -> to most types; bump version
- Loading branch information
Taylor C. Richberger
committed
Nov 23, 2021
1 parent
f4f0c96
commit a48e1f8
Showing
6 changed files
with
345 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* https://github.com/Taywee/args | ||
* | ||
* Copyright (c) 2016-2020 Taylor C. Richberger <[email protected]> and Pavel | ||
* Copyright (c) 2016-2021 Taylor C. Richberger <[email protected]> and Pavel | ||
* Belikov | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -33,10 +33,10 @@ | |
#ifndef ARGS_HXX | ||
#define ARGS_HXX | ||
|
||
#define ARGS_VERSION "6.2.7" | ||
#define ARGS_VERSION "6.3.0" | ||
#define ARGS_VERSION_MAJOR 6 | ||
#define ARGS_VERSION_MINOR 2 | ||
#define ARGS_VERSION_PATCH 7 | ||
#define ARGS_VERSION_MINOR 3 | ||
#define ARGS_VERSION_PATCH 0 | ||
|
||
#include <algorithm> | ||
#include <iterator> | ||
|
@@ -3242,6 +3242,14 @@ namespace args | |
return count; | ||
} | ||
|
||
int &operator *() noexcept { | ||
return count; | ||
} | ||
|
||
const int &operator *() const noexcept { | ||
return count; | ||
} | ||
|
||
virtual void Reset() noexcept override | ||
{ | ||
FlagBase::Reset(); | ||
|
@@ -3394,6 +3402,34 @@ namespace args | |
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T &operator *() noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T &operator *() const noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T *operator ->() noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T *operator ->() const noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
/** Get the default value | ||
*/ | ||
const T &GetDefault() noexcept | ||
|
@@ -3523,6 +3559,34 @@ namespace args | |
return values; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
List<T> &operator *() noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const List<T> &operator *() const noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
List<T> *operator ->() noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const List<T> *operator ->() const noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
iterator begin() noexcept | ||
{ | ||
return values.begin(); | ||
|
@@ -3635,6 +3699,34 @@ namespace args | |
return values; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
Container &operator *() noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container &operator *() const noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
Container *operator ->() noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container *operator ->() const noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
virtual std::string Name() const override | ||
{ | ||
return name + std::string("..."); | ||
|
@@ -3768,6 +3860,34 @@ namespace args | |
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T &operator *() noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T &operator *() const noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T *operator ->() noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T *operator ->() const noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
virtual void Reset() noexcept override | ||
{ | ||
ValueFlagBase::Reset(); | ||
|
@@ -3862,6 +3982,34 @@ namespace args | |
return values; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
Container &operator *() noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container &operator *() const noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
Container *operator ->() noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container *operator ->() const noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
virtual std::string Name() const override | ||
{ | ||
return name + std::string("..."); | ||
|
@@ -3962,6 +4110,34 @@ namespace args | |
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T &operator *() noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T &operator *() const noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T *operator ->() noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T *operator ->() const noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
virtual void Reset() noexcept override | ||
{ | ||
PositionalBase::Reset(); | ||
|
@@ -4039,6 +4215,34 @@ namespace args | |
return values; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
Container &operator *() noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container &operator *() const noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
Container *operator ->() noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container *operator ->() const noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
virtual void Reset() noexcept override | ||
{ | ||
PositionalBase::Reset(); | ||
|
@@ -4160,6 +4364,34 @@ namespace args | |
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T &operator *() noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T &operator *() const noexcept | ||
{ | ||
return value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
T *operator ->() noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
const T *operator ->() const noexcept | ||
{ | ||
return &value; | ||
} | ||
|
||
virtual void Reset() noexcept override | ||
{ | ||
PositionalBase::Reset(); | ||
|
@@ -4255,6 +4487,34 @@ namespace args | |
return values; | ||
} | ||
|
||
/** Get the value | ||
*/ | ||
Container &operator *() noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container &operator *() const noexcept | ||
{ | ||
return values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
Container *operator ->() noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
/** Get the values | ||
*/ | ||
const Container *operator ->() const noexcept | ||
{ | ||
return &values; | ||
} | ||
|
||
virtual std::string Name() const override | ||
{ | ||
return name + std::string("..."); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.