You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dyn_array_iterator cannot convert to const_iterator #1269
dyn_array_iterator<T> declares operator dyn_array_iterator<const T>(), but the conversion builds the target through dyn_array_iterator<const T>'s private state constructor, and that specialization befriends only gsl::dyn_array. Every use of the conversion is an access error, so iterator never converts to const_iterator:
gsl::dyn_array<int> a{1, 2, 3};
gsl::dyn_array<int>::const_iterator it = a.begin(); // error: constructor is privatebool b = a.cend() == a.end(); // same
Reproduces on main (417ef68) with GCC 15 at C++14, 17 and 20. gsl::span's span_iterator avoids this by befriending its own specializations (template <class> friend class span_iterator;).
Activity