• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

### #ActualRyan_001

Posted 25 October 2012 - 11:50 AM

Another quick question. Any time I've seen the typedefs of a container listed (value_type, key_type, ect...) online they've always been defined in terms of the allocator like:
typedef typename allocator_type::value_type value_type;
of perhaps something like:
typedef typename allocator_traits<allocator_type>::value_type value_type;
I always assumed this was to allow proxy types to be used instead of T or perhaps allow other things to go on under the hood. Yet in the standard (in particular N3337 on p703) the container requirements seem to straight up state that value_type (along with reference_type, pointer_type, ect...) is just T. No mess, fuss, or anything. Is this the way its always been or is this something in the newer standard revisions? Or am I reading this incorrectly? Similarly with size_type, difference_type, do I need to define these in terms of the allocator size_type and allocator difference_type, or can I simply set them to size_t and ptrdiff_t?

### #1Ryan_001

Posted 25 October 2012 - 11:43 AM

Another quick question. Any time I've seen the typedefs of a container listed (value_type, key_type, ect...) online they've always been defined in terms of the allocator like:
typedef typename allocator_type::value_type value_type;
of perhaps something like:
typedef typename allocator_traits<allocator_type>::value_type value_type;
I always assumed this was to allow proxy types to be used instead of T or perhaps allow other things to go on under the hood. Yet in the standard (in particular N3337 on p703) the container requirements seem to straight up state that value_type (along with reference_type, pointer_type, ect...) is just T. No mess, fuss, or anything. Is this the way its always been or is this something in the newer standard revisions? Or am I reading this incorrectly?

PARTNERS