Fix util::flat_list::data()
This commit is contained in:
parent
848e474ef4
commit
15f8e04308
1 changed files with 11 additions and 2 deletions
|
|
@ -34,8 +34,17 @@ namespace psemek::util
|
||||||
std::size_t capacity() const { return capacity_; }
|
std::size_t capacity() const { return capacity_; }
|
||||||
bool empty() const { return size_ == 0; }
|
bool empty() const { return size_ == 0; }
|
||||||
|
|
||||||
T * data() { return nodes_.get(); }
|
T * data()
|
||||||
T const * data() const { return nodes_.get(); }
|
{
|
||||||
|
static_assert(sizeof(node) == sizeof(T));
|
||||||
|
return reinterpret_cast<T *>(nodes_.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
T const * data() const
|
||||||
|
{
|
||||||
|
static_assert(sizeof(node) == sizeof(T));
|
||||||
|
return reinterpret_cast<T *>(nodes_.get());
|
||||||
|
}
|
||||||
|
|
||||||
void reserve(std::size_t size);
|
void reserve(std::size_t size);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue