+ 2

Can someone explain this code for me?

set<pair<pair<long long, long long>, long long> > st;

31st Jul 2017, 4:50 PM
Farhan Hanif Alaudin
Farhan Hanif Alaudin - avatar
6 Answers
+ 2
Set is a template class, meaning it can take different params types without making a class for each. Read more about templates to understand :)
31st Jul 2017, 8:42 PM
Yassine Rajjaf
Yassine Rajjaf - avatar
+ 2
"This class couples together a pair of values, which may be of different types (T1 and T2). The individual values can be accessed through its public members first and second" From cplusplus
31st Jul 2017, 9:03 PM
Andrés04_ve
Andrés04_ve - avatar
+ 1
BTW a set is a dynamic array(at lest it is in Java) that store objects without duplication.
31st Jul 2017, 8:43 PM
Yassine Rajjaf
Yassine Rajjaf - avatar
+ 1
what about the pair class? deletes duplicated types?
31st Jul 2017, 8:52 PM
Andrés04_ve
Andrés04_ve - avatar
+ 1
I don't really know, maybe a cpp guru can help, but my guess it's a hashmap, key-value like
31st Jul 2017, 8:57 PM
Yassine Rajjaf
Yassine Rajjaf - avatar
+ 1
I was right? Haha
31st Jul 2017, 9:15 PM
Yassine Rajjaf
Yassine Rajjaf - avatar