vector and initializer_list reference

there is a problem with the vector and initializer_list docs regarding size_type. in gcc at least (maybe it's in the standard?), size_type is currently defined within the vector class.

so in order to use it, you must use the more verbose
std::vector<USER_TYPE>::size_type
not
size_type
otherwise you get a "not declared" error.

apparently initialzer_list is auto-included past a certain c++ compiler version.
but should probably include it anyway when you need to use it, because people using an older compiler should be provided for.

http://www.cplusplus.com/reference/vector/vector/operator%5B%5D/
What are you getting at with this? Are you indicating some deficiency in the link you made? If so, what does vector::operator[] have to do with initializer_lists?

Also, there is a "Spotted an error? contact us" link at the bottom of every page that you may use to report errors.
Topic archived. No new replies allowed.