示例#1
0
static void
TestMakeTuple()
{
  auto tuple = MakeTuple(42, 0.5f, 'c');
  CHECK_TYPE(tuple, Tuple<int, float, char>);
  CHECK(Get<0>(tuple) == 42);
  CHECK(Get<1>(tuple) == 0.5f);
  CHECK(Get<2>(tuple) == 'c');

  // Make sure we don't infer the type to be Tuple<int&>.
  int x = 1;
  auto tuple2 = MakeTuple(x);
  CHECK_TYPE(tuple2, Tuple<int>);
  x = 2;
  CHECK(Get<0>(tuple2) == 1);
}
示例#2
0
static bool
TestMakeTuple()
{
  auto tuple = MakeTuple(42, 0.5f, 'c');
  CHECK_TYPE(tuple, Tuple<int, float, char>);
  CHECK(Get<0>(tuple) == 42);
  CHECK(Get<1>(tuple) == 0.5f);
  CHECK(Get<2>(tuple) == 'c');
  return true;
}