Title
§[iterator.range] and now [iterator.container] aren't available via <initializer_list>
Status
new
Section
[support.initlist][iterator.range]
Submitter
Richard Smith

Created on 2014-11-11.00:00:00 last changed 114 months ago

Messages

Date: 2014-11-11.00:00:00

These sections define helper functions, some of which apply to initializer_list<T>. And they're available if you include one of a long list of header files, many of which include <initializer_list>. But they are not available if you include <initializer_list>. This seems very odd.

#include <initializer_list>
auto x = {1, 2, 3};
const int *p = data(x); // error, undeclared
#include <vector>
const int *q = data(x); // ok
History
Date User Action Args
2014-11-11 00:00:00admincreate