mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Simplify type traits
This commit is contained in:
parent
df21d07bd6
commit
2dc9121acf
@ -126,8 +126,8 @@ public:
|
|||||||
|
|
||||||
// Entry point for template types other than std::vector and std::list
|
// Entry point for template types other than std::vector and std::list
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<is_specialization<T, std::vector>::value == false &&
|
typename std::enable_if<!is_specialization<T, std::vector>::value &&
|
||||||
is_specialization<T, std::list>::value == false, bool>::type
|
!is_specialization<T, std::list>::value, bool>::type
|
||||||
operator==(const T& aRhs) const {
|
operator==(const T& aRhs) const {
|
||||||
return get<T>() == aRhs;
|
return get<T>() == aRhs;
|
||||||
}
|
}
|
||||||
@ -354,8 +354,8 @@ class ArgumentParser {
|
|||||||
|
|
||||||
// Getter enabled for all template types other than std::vector and std::list
|
// Getter enabled for all template types other than std::vector and std::list
|
||||||
template <typename T = std::string>
|
template <typename T = std::string>
|
||||||
typename std::enable_if<is_specialization<T, std::vector>::value == false &&
|
typename std::enable_if<!is_specialization<T, std::vector>::value &&
|
||||||
is_specialization<T, std::list>::value == false, T>::type
|
!is_specialization<T, std::list>::value, T>::type
|
||||||
get(const char * aArgumentName) {
|
get(const char * aArgumentName) {
|
||||||
auto tIterator = mArgumentMap.find(aArgumentName);
|
auto tIterator = mArgumentMap.find(aArgumentName);
|
||||||
if (tIterator != mArgumentMap.end()) {
|
if (tIterator != mArgumentMap.end()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user