how to unpack a set of tuples passed in a mixins Host class (which ultimately are fowarded to the mixins)
<p>I have the following code which works fine in forwarding various <code>std::tuples</code> to the various mixins of my "BaseSensor" host class.</p>

<pre><code>#include &lt;iostream&gt; // std::cout std::endl
#include &lt;string&gt;   // std::string
#include &lt;map&gt;   // std::map
#include &lt;tuple&gt;   // std::map

using namespace std;

struct BaseSensorData
{
    BaseSensorData(const string &amp; _sensorName)
        : sensorName(_sensorName)
    {}

    const string sensorName;
};

class TrendSensor //mixin for BaseSensor
{
    public:
        TrendSensor( BaseSensorData * bsd , std::tuple&lt;size_t , double &gt; &amp;&amp; tp)
        {
            cout &lt;&lt; "TrendSensor: " &lt;&lt; std::get&lt;0&gt;(tp) &lt;&lt; " " &lt;&lt; bsd-&gt;sensorName &lt;&lt; " " &lt;&lt; std::get&lt;1&gt;(tp) &lt;&lt; endl;
        }
};

typedef struct{ double trough; double peak; } Edges;
class EdgeSensor  //mixin for BaseSensor
{
    public:
        EdgeSensor( BaseSensorData * bsd , std::tuple&lt;size_t , double &gt; &amp;&amp; tp)
        {
            cout &lt;&lt; "EdgeSensor: " &lt;&lt; std::get&lt;0&gt;(tp) &lt;&lt; " " &lt;&lt; bsd-&gt;sensorName &lt;&lt; " " &lt;&lt; std::get&lt;1&gt;(tp) &lt;&lt; endl;
        }
};

class CO2Threshold// : public ThresholdData
{
    std::map&lt;std::string , double&gt;thresholds;

    public:
        CO2Threshold( const double &amp; _toxicThres , const double &amp; _zeroThres , const double &amp; )
        {
            thresholds["toxic"] = _toxicThres;
            thresholds["zero"] = _zeroThres;
            cout &lt;&lt; "CO2Threshold: " &lt;&lt; _toxicThres &lt;&lt; " " &lt;&lt; thresholds["zero"] &lt;&lt; endl;
        }
};
class O2Threshold// : public ThresholdData
{
    std::map&lt;std::string , double&gt;thresholds;

    public:
        O2Threshold( const double &amp; _toxicThres , const double &amp; _lowThres , const double &amp; _elecChemThres )
        {
            thresholds["toxic"] = _toxicThres;
            thresholds["low"] = _lowThres;
            thresholds["elecchem"] = _elecChemThres;
            cout &lt;&lt; "O2Threshold: " &lt;&lt; _toxicThres &lt;&lt; " " &lt;&lt; thresholds["low"] &lt;&lt; " " &lt;&lt; thresholds["elecchem"] &lt;&lt; endl;
        }
};

template&lt;typename ThresholdMixin&gt; //CO2Threshold , O2Threshold , or others ...
class ThresholdSensor : public ThresholdMixin  //mixin for BaseSensor
{
    public:
        ThresholdSensor ( BaseSensorData * bsd
                        , std::tuple&lt;size_t , double , double , double , double&gt; &amp;&amp; tp)
            : ThresholdMixin
                ( std::get&lt;2&gt;(tp)
                , std::get&lt;3&gt;(tp)
                , std::get&lt;4&gt;(tp)
                )
        {
            cout &lt;&lt; "ThresholdSensor: " &lt;&lt; std::get&lt;0&gt;(tp) &lt;&lt; " " &lt;&lt; bsd-&gt;sensorName &lt;&lt; " "
                 &lt;&lt;  std::get&lt;1&gt;(tp) &lt;&lt; " " &lt;&lt; std::get&lt;2&gt;(tp) &lt;&lt; " " &lt;&lt; std::get&lt;3&gt;(tp) &lt;&lt; " " &lt;&lt; std::get&lt;4&gt;(tp)
                 &lt;&lt; endl;
        }

};

template&lt;typename ... SensorType&gt;
class BaseSensor : public BaseSensorData , public SensorType ... //to my BaseSensor class
{
    size_t windowSize;
    public:
        template&lt;typename ... Args&gt;
        BaseSensor(const string&amp; _sensorName , Args &amp;&amp; ... args)
            : BaseSensorData(_sensorName)
            , SensorType( this , std::forward&lt;Args&gt;(args) )...
            , windowSize(0U)
        {
            std::tuple&lt;Args...&gt; arr[sizeof...(SensorType)] = { args ... }; //line A
            /*for (size_t i = 0; i &lt; sizeof...(SensorType); ++i)
            {
                for (size_t i = 0; i &lt; sizeof...(Args); ++i)
                {
                    // do stuff
                }
            }*/
            cout &lt;&lt; "BaseSensor: " &lt;&lt; /*_windowSize &lt;&lt; " " &lt;&lt; */sensorName &lt;&lt; " " &lt;&lt; endl;
        }

};

int main() {
    BaseSensor&lt;ThresholdSensor&lt;O2Threshold&gt; , TrendSensor, EdgeSensor&gt;bs
    {
        string("testSensor")
        , std::make_tuple&lt;size_t , double , double , double , double&gt;( 54U , 2.5f , 10000.3f , 400.5f , 200.3f )
        , std::make_tuple&lt;size_t , double &gt;( 53U , 6.5f )
        , std::make_tuple&lt;size_t , double &gt;( 52U , 3.5f )
    };

    /*BaseSensor&lt;ThresholdSensor&lt;CO2Threshold&gt; , TrendSensor, EdgeSensor&gt;bs5
    {
        string("testSensor")
        , std::make_tuple&lt;size_t , double , double , double , double&gt;( 54U , 2.5f , 10000.3f , 400.5f , 200.3f )
        , std::make_tuple&lt;size_t , double &gt;( 53U , 6.5f )
        , std::make_tuple&lt;size_t , double &gt;( 52U , 3.5f )
    };*/
    //BaseSensor&lt;ThresholdSensor&lt;CO2Threshold&gt; &gt; bs2{string("test"),11U , 12.5f};
    //BaseSensor&lt;TrendSensor&gt; bs3{string("test"), 8U , 10.5f};
    //BaseSensor&lt;EdgeSensor&gt; bs4{string("test"), 6U , 18.5f};

}
</code></pre>

<p>So in "BaseSensor" the tuples of all mixins (ie the "SensorTypes ...") are forwarded through the "Args ..." parameter pack. This works fine but I need in the <code>BaseSensor::BaseSensor()</code> body to get access to those tuples. The syntax for doing that however eludes me. </p>

<p>how can I expand at the same time <code>SensorType ...</code> and <code>Args ...</code> and categorize the "args" according to tuple? 
With the code above, I get the following in g++ v4.7.1 and c++11 enabled:</p>

<pre><code>varcon.cpp:104:64: error: could not convert ‘args#0’ from ‘std::tuple&lt;long unsigned int, double, double, double, double&gt;’ to ‘std::tuple&lt;std::tuple&lt;long unsigned int, double, double, double, double&gt;, std::tuple&lt;long unsigned int, double&gt;, std::tuple&lt;long unsigned int, double&gt; &gt;’
varcon.cpp:104:64: error: could not convert ‘args#1’ from ‘std::tuple&lt;long unsigned int, double&gt;’ to ‘std::tuple&lt;std::tuple&lt;long unsigned int, double, double, double, double&gt;, std::tuple&lt;long unsigned int, double&gt;, std::tuple&lt;long unsigned int, double&gt; &gt;’
varcon.cpp:104:64: error: could not convert ‘args#2’ from ‘std::tuple&lt;long unsigned int, double&gt;’ to ‘std::tuple&lt;std::tuple&lt;long unsigned int, double, double, double, double&gt;, std::tuple&lt;long unsigned int, double&gt;, std::tuple&lt;long unsigned int, double&gt; &gt;’
varcon.cpp:108:59: error: incomplete type ‘std::tuple_size&lt;std::tuple&lt;std::tuple&lt;long unsigned int, double, double, double, double&gt;, std::tuple&lt;long unsigned int, double&gt;, std::tuple&lt;long unsigned int, double&gt; &gt;&amp;&gt;’ used in nested name specifier
</code></pre>