title: Convert C Array to Variadic Template Argument
body: <p>I have been exploring CPP and would like to know if something as this is possible:</p>
  
  <p>A variadic template class that converts an array of N elements to a function call with a variadic list of arguments.</p>
  
  <p>For example, if given an array such</p>
  
  <pre><code>argc = 3, args = { "hello", "10", "0.5" }
  </code></pre>
  
  <p>my wish is to be able to call like this</p>
  
  <pre><code>Something&lt;std::string, int, float&gt;(3, args);
  </code></pre>
  
  <p>this will do some processing to call function with the converted arguments</p>
  
  <p>Previous resources I have explored are trying to use C++14's expression folding or trying to use a recursive template. I think that one must use a parameter pack and some definition to convert this. Here is my code so far</p>
  
  <p>Assuming want to convert array of C-strings to argument, I have created many conversion structs</p>
  
  <p>Here I have a struct to convert char* (the element of array) to some unknown argument</p>
  
  <pre><code>// generic conversion
  template &lt;typename T&gt;
  struct convert {
    T operator()(char const*) const;
  };
  
  // specific convert char* to std::string
  template &lt;&gt;
  struct convert&lt;std::string&gt; {
    std::string operator()(char const* str) const {
      return std::string(str);
    }
  };
  
  // many different convert&lt;&gt; structs for different types...
  </code></pre>
  
  <p>Now here is where the issue lives. In this class I try to build representation of arbitrary converter of N elements of C-string</p>
  
  <pre><code>class Handler {
  public:
    virtual bool Handle(int argc, char const** argv);
  };
  
  template &lt;typename... Args&gt;
  class Command : public Handler {
  protected:
    bool Execute(Args... args);
  
  public:
    bool Handle(int argc, char const** argv) override {
      if (argc != sizeof...(Args))
        return false;
      // HELP call convert&lt;&gt; on each type in args then call Execute();
    }
  };
  </code></pre>
  
  <p>For mine HELP, I explore other question to try parameter unpack or expression folding, but it do not like him.</p>
  
  <p>For example one implementation of command is</p>
  
  <pre><code>class Help : public Command&lt;std::string&gt; {
  public:
    bool Execute(std::string sub) {
  
    }
  };
  </code></pre>
  
  <p>I try also to use CPP14 index sequence, but mine issue is for having two "arrays" in index sequence to iterate. char** and variadic templates.</p>
  
  <p>Thank you!</p>