| // Copyright 2018 The RE2 Authors. All Rights Reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| #ifndef UTIL_POD_ARRAY_H_ |
| #define UTIL_POD_ARRAY_H_ |
| static_assert(std::is_pod<T>::value, |
| explicit PODArray(int len) |
| : ptr_(std::allocator<T>().allocate(len), Deleter(len)) {} |
| return ptr_.get_deleter().len_; |
| T& operator[](int pos) const { |
| explicit Deleter(int len) |
| void operator()(T* ptr) const { |
| std::allocator<T>().deallocate(ptr, len_); |
| std::unique_ptr<T[], Deleter> ptr_; |
| #endif // UTIL_POD_ARRAY_H_ |