c++ - tuple t1(1), t2(2), t3(3); -
c++ - tuple<int, 3> t1(1), t2(2), t3(3); -
i know tuple object holds collection of elements. i've encountered tuples tuple<int, double, string> student{15, 13.2, "mike"} i've encountered 1 don't seem understand, tuple<int, 3> t1(1), t2(2), t3(3); first argument integer , 3 represent, along t()? lot.
you should getting this:
error: type/value mismatch @ argument 1 in template parameter list ‘template<class ...> class std::tuple’ error: expected type, got ‘3’ ... clearly compiler says there not such constructor std::tuple. should check if code using uses own tuple, instead of standard.
if std::tuple, code not compile, it's wrong.
check ref, can see compiler (as usual) right.
ps - next time format question improve because took wrong impression , made pointless answer.
c++ tuples
Comments
Post a Comment