Skip to content
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

Fixes for c++20 #6446

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@ struct Type {
return type != other.type || (code() == Handle && !same_handle_type(other));
}

/** Compare two types for equality */
bool operator==(const halide_type_t &other) const {
return type == other;
}

/** Compare two types for inequality */
bool operator!=(const halide_type_t &other) const {
return type != other;
}

/** Compare ordering of two types so they can be used in certain containers and algorithms */
bool operator<(const Type &other) const {
if (type < other.type) {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/HalideBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct DeviceRefCount {
template<typename T = void, int D = 4>
class Buffer {
/** The underlying halide_buffer_t */
halide_buffer_t buf = {0};
halide_buffer_t buf = {};

/** Some in-class storage for shape of the dimensions. */
halide_dimension_t shape[D];
Expand Down