+// Similar to the begin() template functions, but instread of returing
+// an iterator, return a pointer to data.
+template <class Container>
+typename Container::value_type* dataPtr(Container& cont) {
+ // NOTE: &cont[0] is undefined if cont is empty (it creates a
+ // reference to nullptr - which is not dereferenced, but still UBSAN).
+ return cont.data();
+}
+template <class T, size_t N>
+constexpr T* dataPtr(T (&arr)[N]) noexcept {
+ return &arr[0];
+}
+