Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe the following will do what you want. First you need a utility:</p> <pre><code>// make_tuple_indices template &lt;size_t...&gt; struct tuple_indices {}; template &lt;size_t _Sp, class _IntTuple, size_t _Ep&gt; struct make_indices_imp; template &lt;size_t _Sp, size_t ..._Indices, size_t _Ep&gt; struct make_indices_imp&lt;_Sp, tuple_indices&lt;_Indices...&gt;, _Ep&gt; { typedef typename make_indices_imp&lt;_Sp+1, tuple_indices&lt;_Indices..., _Sp&gt;, _Ep&gt;::type type; }; template &lt;size_t _Ep, size_t ..._Indices&gt; struct make_indices_imp&lt;_Ep, tuple_indices&lt;_Indices...&gt;, _Ep&gt; { typedef tuple_indices&lt;_Indices...&gt; type; }; template &lt;size_t _Ep, size_t _Sp = 0&gt; struct make_tuple_indices { static_assert(_Sp &lt;= _Ep, "make_tuple_indices input error"); typedef typename make_indices_imp&lt;_Sp, tuple_indices&lt;&gt;, _Ep&gt;::type type; }; </code></pre> <p>Then you can use this to help you expand a tuple holding your arguments:</p> <pre><code>template&lt;typename _Classname, typename... Args&gt; class CFunctorStartExT { friend class CXXFactory; protected: template&lt;typename U&gt; CFunctorStartExT(U&amp; _functor, Args&amp;... args) : m_Functor(_functor), m_args(args...) { } virtual bool ProcessLoop(CSomeClass* pThread) { return ProcessLoop(pThread, typename make_tuple_indices&lt;sizeof...(Args)&gt;::type()); } protected: _Classname&amp; m_Functor; std::tuple&lt;Args...&gt; m_args; private: template &lt;std::size_t ...Indx&gt; bool ProcessLoop(CSomeClass* pThread, tuple_indices&lt;Indx...&gt;) { return m_Functor(pThread, std::get&lt;Indx&gt;(m_args)...); } }; </code></pre> <p>As far as VS2010 variadic template support: I have no idea.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload