Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an empty std::tuple?

Tags:

c++

stdtuple

I need to construct an std::tuple object so that std::tuple_size<T>::value = 0. Is there a way to do this?

like image 786
Darius Duesentrieb Avatar asked Aug 25 '26 10:08

Darius Duesentrieb


1 Answers

std::tuple<> empty;
using empty_t = std::tuple<>;
auto empty2 = std::make_tuple();
static_assert(std::tuple_size<std::tuple<>>::value == 0);
like image 116
cmdLP Avatar answered Aug 28 '26 00:08

cmdLP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!