view: add make_cview function for pointers

This commit is contained in:
Danny Robson 2017-03-23 14:36:56 +11:00
parent b67a99ee4e
commit 4f398620ab

View File

@ -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);