Webastor - Programming Tips and Tricks

Programming language => C++ => Topic started by: Rayyan on November 17, 2016, 07:04:54 PM

Title: How does direct comparison between tuples in c++ work?
Post by: Rayyan on November 17, 2016, 07:04:54 PM
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.
Title: Re: Between tuples in c++ work
Post by: Aleksander on April 30, 2017, 10:02:53 AM
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.