Browse Source

prevector: add C++11-like data() method

This returns a pointer to the beginning of the vector's data.
tags/v0.15.1
Wladimir J. van der Laan 5 years ago
parent
commit
47314e6daa
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/prevector.h

+ 8
- 0
src/prevector.h View File

@@ -475,6 +475,14 @@ public:
return ((size_t)(sizeof(T))) * _union.capacity;
}
}

value_type* data() noexcept {
return item_ptr(0);
}

const value_type* data() const {
return item_ptr(0);
}
};
#pragma pack(pop)


Loading…
Cancel
Save