Skip to content

Commit

Permalink
Containers: add a TODO for a completeness check in the Array deleter.
Browse files Browse the repository at this point in the history
Feels rather impossible to achieve.
  • Loading branch information
mosra committed Jun 29, 2024
1 parent bbaa9ce commit 7acb8b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Corrade/Containers/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ namespace Implementation {
template<class T> struct CallDeleter<T, void(*)(T*, std::size_t)> {
void operator()(void(*deleter)(T*, std::size_t), T* data, std::size_t size) const {
if(deleter) deleter(data, size);
/** @todo could this have some compile-time check for type
completeness like Pointer has with IsComplete, but one that
doesn't trigger if the deleter is set? having that checked only
at runtime feels awful */
else delete[] data;
}
};
Expand Down

0 comments on commit 7acb8b1

Please sign in to comment.