| 198 | const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); } |
| 199 | |
| 200 | void fill(T* dst, ptrdiff_t count) { |
| 201 | if (IS_TRIVIALLY_CONSTRUCTIBLE<T>::value) { |
| 202 | // The most common use of prevector is where T=unsigned char. For |
| 203 | // trivially constructible types, we can use memset() to avoid |
| 204 | // looping. |
| 205 | ::memset(dst, 0, count * sizeof(T)); |
| 206 | } else { |
| 207 | for (auto i = 0; i < count; ++i) { |
| 208 | new(static_cast<void*>(dst + i)) T(); |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | void fill(T* dst, ptrdiff_t count, const T& value) { |
| 214 | for (auto i = 0; i < count; ++i) { |
no outgoing calls
no test coverage detected