Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Later
-
None
-
None
Description
It would be nice if the cpp compiler could generate code to use unordered_set instead of set. unordered_set is faster & usually an unordered_set is wanted rather than an ordered one. Furthermore, since unordered_set only needs a hash function, we could generate one for every type.
The hash code generated can be along the lines of what Eclipse does for auto-generated hash codes:
struct ThriftObj {
1: string f1;
2: i32 f2;
3: SomeOtherThriftObj f3;
}
// header file:
namespace std {
template <> struct hash<ThriftObj>
}
// cpp file:
namespace std {
template <> struct hash<ThriftObj>
}
}
Attachments
Issue Links
- relates to
-
THRIFT-2717 C++V2 generator/library
- Open