-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drt: Contiguous GC data #6016
base: master
Are you sure you want to change the base?
drt: Contiguous GC data #6016
Changes from all commits
f881a91
c0d87ad
d11654e
a0265fc
3a35d15
6135fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||
#pragma once | ||||||
#include <vector> | ||||||
|
||||||
template <typename T> | ||||||
class dynarray | ||||||
{ | ||||||
public: | ||||||
dynarray() = default; | ||||||
dynarray(std::vector<T>&& data) : data(std::move(data)) {} | ||||||
dynarray(size_t size) : data(size) {} | ||||||
T& operator[](size_t idx) { return data[idx]; } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
Suggested change
Additional context/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here typedef __SIZE_TYPE__ size_t;
^ |
||||||
const T& operator[](size_t idx) const { return data[idx]; } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
Suggested change
Additional context/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here typedef __SIZE_TYPE__ size_t;
^ |
||||||
auto begin() { return data.begin(); } | ||||||
auto begin() const { return data.begin(); } | ||||||
auto end() { return data.end(); } | ||||||
auto end() const { return data.end(); } | ||||||
size_t size() const { return data.size(); } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
Suggested change
Additional context/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here typedef __SIZE_TYPE__ size_t;
^ |
||||||
void clear() { data.clear(); } | ||||||
T& front() { return data.front(); } | ||||||
const T& front() const { return data.front(); } | ||||||
T& back() { return data.back(); } | ||||||
const T& back() const { return data.back(); } | ||||||
|
||||||
private: | ||||||
std::vector<T> data; | ||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
Additional context
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279: 'std::size_t' declared here