How does direct comparison between tuples in c++ work?

Started by Firas, November 17, 2016, 07:04:54 PM

Previous topic - Next topic

Rayyan

Hi everyone, I have a question that has bothered me for a long time, how does direct comparison between tuples in c++ work? Thank you kindly for giving me your help as soon as possible.

Aleksander

The C++ tuple syntax can be quite a bit more verbose than most people would like.

Consider:

typedef boost::tuple<MyClass1,MyClass2,MyClass3> MyTuple;
So if you want to make extensive use of tuples you either get tuple typedefs everywhere or you get annoyingly long type names everywhere. I like tuples. I use them when necessary. But it's usually limited to a couple of situations, like an N-element index or when using multimaps to tie the range iterator pairs. And it's usually in a very limited scope.