Wednesday, 15 April 2015

c++ - binary '[' : 'std::initializer_list' does not define this operator or a conversion to a type acceptable to the predefined operator -



c++ - binary '[' : 'std::initializer_list<const char *>' does not define this operator or a conversion to a type acceptable to the predefined operator -

how access value initializer declared using auto keyword?

auto arr = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; auto = arr[0];

give next compile-error on vs:

binary '[' : 'std::initializer_list' not define operator or conversion type acceptable predefined operator

take @ interface of std::initializer_list:

auto arr = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; auto = *arr.begin();

(or, more practical, initialize container or array braced-init-list)

c++ c++11 visual-studio-2013

No comments:

Post a Comment