| | |
| | | const T *data(const std::vector<T, Alloc> &v) { |
| | | // Eventually the returned pointer gets passed down to memcpy, so |
| | | // we need it to be non-null to avoid undefined behavior. |
| | | alignas(T) static uint8_t t; |
| | | |
| | | alignas(T) static uint8_t t; /*#<<<DIA_SVACE_MAJOR>>>*/ |
| | | return v.empty() ? reinterpret_cast<const T *>(&t) : &v.front(); |
| | | } |
| | | template<typename T, typename Alloc = std::allocator<T>> |
| | | T *data(std::vector<T, Alloc> &v) { |
| | | // Eventually the returned pointer gets passed down to memcpy, so |
| | | // we need it to be non-null to avoid undefined behavior. |
| | | alignas(T) static uint8_t t; |
| | | |
| | | alignas(T) static uint8_t t; /*#<<<DIA_SVACE_MAJOR>>*/ |
| | | return v.empty() ? reinterpret_cast<T *>(&t) : &v.front(); |
| | | } |
| | | |