Search code examples
c++stdtuple

How to create an empty std::tuple?


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


Solution

  • std::tuple<> empty;
    using empty_t = std::tuple<>;
    auto empty2 = std::make_tuple();
    static_assert(std::tuple_size<std::tuple<>>::value == 0);