I am not able to parse the meaning of the following line of code:
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
This is the code for allocator rebinding (line 63 of https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.5/a00756_source.html)
How is this different from the following?
typedef typename Allocator::rebind<Mapped>::other mapped_type_allocator;
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
This is a templated typedef - it establishes mapped_type_allocator
as an alias for a template.
typedef typename Allocator::rebind<Mapped>::other mapped_type_allocator;
This is a typedef for a type. To compile OK, the Mapped
would need to be defined/known.
The Allocator::rebind<typename X>::other
(as a concept) is expected to define a template, not a type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With