Skip to content

Commit

Permalink
static_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Oct 18, 2024
1 parent 1d1ccbd commit 8857bb7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Core/include/Acts/Utilities/Any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,13 @@ class AnyBase : public AnyBaseAll {
assert(from != nullptr && "Source is null");
const T* _from = static_cast<const T*>(from);
if (to == nullptr) {
assert(heapAllocated<T>() && "Received nullptr in local buffer case");
static_assert(heapAllocated<T>(),
"Received nullptr in local buffer case");
to = new T(*_from);
_ACTS_ANY_TRACK_ALLOCATION(T, to);

} else {
assert(!heapAllocated<T>() && "Received non-nullptr in heap case");
static_assert(!heapAllocated<T>(), "Received non-nullptr in heap case");
/*T* ptr =*/new (to) T(*_from);
}
return to;
Expand Down

0 comments on commit 8857bb7

Please sign in to comment.