Browse Source

refactor: compact template names a bit

Sam Jaffe 2 years ago
parent
commit
d70f81bf50
2 changed files with 7 additions and 9 deletions
  1. 3 4
      include/program_args/arguments.h
  2. 4 5
      include/program_args/arguments_impl.hpp

+ 3 - 4
include/program_args/arguments.h

@@ -49,10 +49,9 @@ protected:
 
   template <typename T> T const * parent() const { return parent_.get<T>(); }
 
-  template <typename Tuple, typename Default, size_t... Is, typename... Parents>
-  int invoke_action(Default const & default_action, Tuple const & tuple,
-                    std::index_sequence<Is...>,
-                    Parents const &... parents) const;
+  template <typename DA, typename T, size_t... Is, typename... Ps>
+  int invoke_action(DA const & default_action, T const & tuple,
+                    std::index_sequence<Is...>, Ps const &... ps) const;
 
 protected:
   /**

+ 4 - 5
include/program_args/arguments_impl.hpp

@@ -345,15 +345,14 @@ auto Arguments<Impl>::option(char abbrev, std::string const & description) {
 }
 
 template <typename Impl>
-template <typename Tuple, typename Default, size_t... Is, typename... Parents>
-int Arguments<Impl>::invoke_action(Default const & default_action,
-                                   Tuple const & tuple,
+template <typename DA, typename T, size_t... Is, typename... Ps>
+int Arguments<Impl>::invoke_action(DA const & default_action, T const & tuple,
                                    std::index_sequence<Is...>,
-                                   Parents const &... parents) const {
+                                   Ps const &... ps) const {
   // Only actions that were reached in the constructor will ever have the
   // primed_ flag set to true. Therefore, there is a guarantee that this
   // function will only call invoke() on a child one or zero times.
-  auto invoke_one = [&parents...](auto const & action) {
+  auto invoke_one = [&ps...](auto const & action) {
     if (!action.primed_) { return std::make_pair(false, 0); }
     return std::make_pair(true, action.invoke(parents...));
   };