Top "Stdtuple" questions

Use this tag for questions about the C++ standard library template std::tuple.

How can you iterate over the elements of an std::tuple?

How can I iterate over a tuple (using C++11)? I tried the following: for(int i=0; i<std::tuple_…

c++ c++11 iteration template-meta-programming stdtuple
Difference between std::pair and std::tuple with only two members?

Is there a difference between an std::pair and an std::tuple with only two members? (Besides the obvious that …

c++ visual-studio-2010 tuples std-pair stdtuple
Using tuple in unordered_map

I want to use tuple consisting of int,char,char in my unordered_map. I am doing like this: #include &…

c++ hashmap unordered-map stdtuple
STL-pair-like triplet class - do I roll my own?

I want to use a triplet class, as similar as possible to std::pair. STL doesn't seem to have one. …

c++ c++-standard-library stdtuple triplet
How to get reference to an element of a std::tuple?

You can get the value of the nth element of an std::tuple using std::get<n>(tuple). …

c++ reference stdtuple
Why is std::pair faster than std::tuple

Here is the code for testing. Tuple test: using namespace std; int main(){ vector<tuple<int,int>&…

performance c++11 std-pair stdtuple
What's the best way to return a tuple from function in C++11?

I want to return some values from a function and I want to pack it in a tuple. So I …

c++ c++11 stdtuple
What is the reason for `std::make_tuple`?

I mean why does std::make_tuple exist? I know that there are situations where the function reduces the amount …

c++ c++11 stdtuple
How does std::get work?

After trying to make a std::get<N>(std::tuple) method myself, I'm not so sure how it's …

c++ templates c++11 tuples stdtuple
Access tuple element in C++11 via compile time variable in function

The following minimal example compiles with g++ -std=c++11 -Wall tuple.cpp -o tuple: #include <tuple> #include <…

c++ c++11 stdtuple