title: Is there easier way to check for a variadic template type?
body: <p>I've got a function</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename T, typename FuncT, typename ... Args&gt;
  static void Submit(Handle&lt;T&gt; handle, FuncT&amp;&amp; funcT, Args&amp;&amp; ... args);
  </code></pre>
  <p><code>Handle</code> is a class that contains an index to the data inside some array. This data can be retrieved through a <code>handle_cast</code> function.</p>
  <pre class="lang-cpp prettyprint-override"><code>T&amp; data = *handle_cast&lt;T*&gt;(handle);
  </code></pre>
  <p>I'm not going to cover this implementation, because it's not related to my question.</p>
  <p><code>Handle&lt;T&gt; handle</code> is the main handle to a resource. I'd like <code>args</code> to be a mix, sometimes it'd be a handle, sometimes a different data.</p>
  <p><code>FuncT</code> first argument is <code>T&amp;</code> and the rest of the arguments might be either <code>*handle_cast&lt;Args*&gt;</code> if this argument is <code>Handle&lt;Some Type&gt;</code> or just <code>Arg</code></p>
  <p>I came out with this solution, but I'm not sure if it's correct or maybe it could be done easier.</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename T, typename FuncT, typename ... Args&gt;
      static void Submit(Handle&lt;T&gt; handle, FuncT&amp;&amp; funcT, Args&amp;&amp; ... args) 
  {
      std::variant&lt;Args...&gt; v;
      bool isHandle = std::visit([](auto&amp;&amp; arg) {
          using T = std::decay_t&lt;decltype(arg)&gt;;
          if constexpr (std::is_base_of_v&lt;HandleBase, T&gt;) {
              return true;
          } return false;
      }, v);
  
      func(*handle_cast&lt;T*&gt;(handle), std::forward&lt;Args&gt;(isHandle ? *handle_cast&lt;Args*&gt;(args) : args)...);
  }
  </code></pre>
  <p>Is this solution ok or it can be done easier/cleaner?</p>