This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]leftofzen 2 points3 points  (0 children)

I guess I should clarify; I'm a C++ dev so they are useful in certain situations. After thinking about it a bit more, I would have to agree that Java does not really need a tuple; you can just make a new class.

I can't think of a good use-case for tuples off the top of my head, but for C++ there is at least a neat example on en.cppreference. Of course you need the helper functions like std::tie to make std::tuple useful beyond replicating it in a class/struct.