Will
std::is_empty<std::tuple<Args...>>::value
return true if every type in Args is empty? A quick test in gcc 4.9 indicates that this is the case but is it required by the standard?
No, there's no requirement that tuple use inheritance to enable the empty base class optimisation.
The only textual specification of the tuple library is:
This subclause describes the tuple library that provides a tuple type as the class template tuple that can be instantiated with any number of arguments. Each template argument specifies the type of an element in the tuple. Consequently, tuples are heterogeneous, fixed-size collections of values. An instantiation of tuple with two arguments is similar to an instantiation of pair with the same two arguments.
with no mention of any implementation details; and the template specification begins:
template <class... Types>
class tuple {
not specifying that it must inherit from anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With