CaseyCarter / cmcstl2

An implementation of C++ Extensions for Ranges
Other
221 stars 68 forks source link

add const_view #346

Open dvirtz opened 4 years ago

dvirtz commented 4 years ago

I plan to make a proposal out of this and would like to have an implementation looked at beforehand.

Note that the adapter is named views::as_const as opposed to const_ in range-v3. This is inspired by the fact that views::move is conceptually applying std::move on every element the same way that this view conceptually applies std::as_const. Another possible name is const_elements, suggested by @cjdb.