Commit
3db10b2385ba591e9ca7ebd5e31d009d0aa4b30d
by Devin PapineauDefine TR::map and TR::set analogously to TR::vector and TR::list
When using std::map and std::set directly, the TR::typed_allocator must
always be specified explicitly. Since the allocator parameter is last,
the comparator must be given explicitly as well even if the default of
std::less would be appropriate, which is often the case. As a result,
typical uses of std::map and std::set take up multiple lines just to
write down the type.
Additionally, when specifying the allocator for std::map, the key
(first) type in the std::pair type provided to TR::typed_allocator must
be const-qualified. In the past it has been possible to forget const,
which resulted in strange consequences. For example, here's a commit
adding a forgotten const: 10dbf7e4e591ba0e.
This commit defines subtypes TR::map and TR::set that take care of
wrapping the allocator in TR::typed_allocator. The default allocator
(TR::Region&) should almost always be usable, in which case it can be
omitted, and it might also be possible to omit the comparator. (Note
that this default differs from that of TR::vector and TR::list, but
TR::Region& might arguably be a better default for those as well.)
(commit: 3db10b2)