Skip to content

Commit d10c8e2

Browse files
authored
Merge pull request #1749 from Xiretza/aligned_allocator_eq
aligned_allocator: add operator==
2 parents 827170f + 3ef5c2b commit d10c8e2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libs/libvtrutil/src/vtr_memory.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ struct aligned_allocator {
136136
}
137137
};
138138

139+
/**
140+
* @brief compare two aligned_allocators.
141+
*
142+
* Since the allocator doesn't have any internal state, all allocators for a given type are the same.
143+
*/
144+
template<typename T>
145+
bool operator==(const aligned_allocator<T>&, const aligned_allocator<T>&) {
146+
return true;
147+
}
148+
139149
} // namespace vtr
140150

141151
#endif

0 commit comments

Comments
 (0)