incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject tuple space optimization
Date Wed, 02 Jul 2008 14:31:16 GMT
The test case below passes with GNU libstdc++ in gcc 4.3. I think
it should pass with stdcxx too (i.e., ideally including the test
cases that libstdc++ fails on, although I haven't looked into
whether it's possible without too much effort).

Martin


#include <cassert>
#include <tuple>

struct S { };

int main ()
{
     assert (sizeof (std::tuple<S>)      == sizeof (std::tuple<>));
     assert (sizeof (std::tuple<S, int>) == sizeof (int));
     assert (sizeof (std::tuple<int, S>) == sizeof (int));

#ifndef  __GLIBCXX__

     assert (sizeof (std::tuple<S, S>)      == sizeof (std::tuple<>));
     assert (sizeof (std::tuple<S, S, S>)   == sizeof (std::tuple<>));

     assert (sizeof (std::tuple<S, S, int>) == sizeof (int));
     assert (sizeof (std::tuple<S, int, S>) == sizeof (int));
     assert (sizeof (std::tuple<int, S, S>) == sizeof (int));
     assert (sizeof (std::tuple<int, S, S>) == sizeof (int));

#endif

}

Mime
View raw message