view: add make_cview function for pointers
This commit is contained in:
parent
b67a99ee4e
commit
4f398620ab
7
view.hpp
7
view.hpp
@ -87,6 +87,13 @@ namespace util {
|
|||||||
return view<T> {first, last};
|
return view<T> {first, last};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
auto
|
||||||
|
make_cview (T *first, T *last)
|
||||||
|
{
|
||||||
|
return view<const T*> {first, last};
|
||||||
|
}
|
||||||
|
|
||||||
// string conversions
|
// string conversions
|
||||||
view<const char*> make_view (const char *str);
|
view<const char*> make_view (const char *str);
|
||||||
view<char*> make_view (char *str);
|
view<char*> make_view (char *str);
|
||||||
|
Loading…
Reference in New Issue
Block a user