Optional base class template to get conditional data members
I only have a few comments. First, you probably want to inherit your bases privately:

template&lt;class T&gt;
class Test
:
    private Base0, // unconditional base class
    private xstd::optional_base&lt;Trait1_v&lt;T&gt;, Base1&gt;,
    private xstd::optional_base&lt;Trait2_v&lt;T&gt;, Base2&gt;
{ };


After all, your design is about adding data members. That's something that you probably don't want to expose to the outside world. 

Secondly, what happens if you want to potentially have multiple different members of the same type? That's definitely going to come up and so should be supported. In order to do that, you might want to add some kind of ID to differentiate them and then additionally wrap the non-empty case. That is:

template &lt;class, int &gt;
struct empty_base { ... }; // same as before

template &lt;class T, int &gt;
struct wrapped {
    T val;
};  

template &lt;bool Condition, class T, int UniqueID = 0&gt;
using optional_base = std::conditional_t&lt;Condition,
                                         wrapped&lt;T, UniqueID&gt;,
                                         empty_base&lt;T, UniqueID&gt;&gt;;


This will additionally let you use non-class types as optional data members (since you couldn't inherit from, e.g. int). So you can now do something like:

template &lt;class T&gt;
class Test
: private xstd::optional_base&lt;Trait1_v&lt;T&gt;, int, 0&gt;
, private xstd::optional_base&lt;Trait2_v&lt;T&gt;, int, 1&gt;
{ ... };


That adds an inconvenience that you have to explicitly add the sequence 0, 1, ...



You can get around that by making a linear inheritance list of all your optional bases. I'm not sure if it's worth it, but I'll present the idea just as an option. At its core, we have OptionalBasesImpl which will inherit from all the optional bases and provide a getter so that the derived class can actually use them:

template &lt;typename... &gt;
struct typelist { };

template &lt;int, typename... &gt;
struct OptionalBasesImpl;


The root case is empty:

template &lt;int ID&gt;
struct OptionalBasesImpl&lt;ID&gt;
{
    OptionalBasesImpl() = default;
    template &lt;typename... Args&gt;
    OptionalBasesImpl(Args&amp;&amp;... ) { }

    void get(typelist&lt;&gt; ) { }
};


And we recurse over each pair of type trait/type:

template &lt;int ID, typename Cond, typename T, typename... Rest&gt;
struct OptionalBasesImpl&lt;ID, Cond, T, Rest...&gt;
: private xstd::optional_base&lt;Cond::value, T, ID&gt;
, OptionalBasesImpl&lt;ID + 1, Rest...&gt;
{
    using Base = xstd::optional_base&lt;Cond::value, T, ID&gt;;
    using Root = OptionalBasesImpl&lt;ID + 1, Rest...&gt;;

    OptionalBasesImpl() = default;

    template &lt;typename Arg, typename... Args&gt;
    OptionalBasesImpl(Arg&amp;&amp; a0, Args&amp;&amp;... args)
    : Base{std::forward&lt;Arg&gt;(a0)}
    , Root(std::forward&lt;Args&gt;(args)...)
    { }

protected:
    using Root::get;

    // by conditional/type pair
    Base&amp; get(typelist&lt;Cond, T&gt; ) { return *this; }
    Base const&amp; get(typelist&lt;Cond, T&gt; ) const { return *this; }

    // by index
    Base&amp; get(std::integral_constant&lt;int, ID&gt; ) { return *this; } 
    Base const&amp; get(std::integral_constant&lt;int, ID&gt; ) const { return *this; }
};


Now we just have the top-level class to start us off at 0:

template &lt;typename... T&gt;
struct OptionalBases : OptionalBasesImpl&lt;0, T...&gt; {
protected:
    using OptionalBasesImpl&lt;0, T...&gt;::OptionalBasesImpl;
    using OptionalBasesImpl&lt;0, T...&gt;::get;
};


which lets you write something like:

template &lt;typename T&gt;
struct Test
: private OptionalBases&lt;std::is_integral&lt;T&gt;, int,
                        std::is_same&lt;T, int&gt;, int&gt;
{
    using Bases = OptionalBases&lt;std::is_integral&lt;T&gt;, int,
                        std::is_same&lt;T, int&gt;, int&gt;;
    using Bases::Bases;

    void printFirst() {
        std::cout &lt;&lt; Bases::get(typelist&lt;std::is_integral&lt;T&gt;, int&gt;{}).val &lt;&lt; std::endl;
    }

    void printSecond() {
        std::cout &lt;&lt; Bases::get(std::integral_constant&lt;int, 1&gt;{}).val &lt;&lt; std::endl;
    }
};

int main() {
    Test&lt;int&gt; t{1, 2};
    t.printFirst();
    t.printSecond();
}


That's a lot of extra boilerplate for just avoiding writing a sequence of integers, so YMMV.