You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some trouble using Jolt's overidden new/delete operators with a placement new syntax. Here is an example code:
using T = JPH::BodyID;
T source;
T target;
new(&target) T(source);
Which compiles with the following error (Xcode15.3 on macOS, using Jolt 4.0.2):
/Users/jedumas/external/git/JoltPhysicsHelloWorld/Source/HelloWorld.cpp:366:2: error: no matching function for call to 'operator new'
new(&target) T(source);
^ ~~~~~~~~~
/Users/jedumas/external/git/JoltPhysicsHelloWorld/Build/build/_deps/joltphysics-src/Build/../Jolt/Physics/Body/BodyID.h:15:2: note: candidate function not viable: no known conversion from 'T *' (aka 'JPH::BodyID *') to 'std::align_val_t' for 2nd argument
JPH_OVERRIDE_NEW_DELETE
^
/Users/jedumas/external/git/JoltPhysicsHelloWorld/Build/build/_deps/joltphysics-src/Build/../Jolt/Core/Memory.h:34:19: note: expanded from macro 'JPH_OVERRIDE_NEW_DELETE'
JPH_INLINE void *operator new (size_t inCount, std::align_val_t inAlignment) { return JPH::AlignedAllocate(inCount, static_cast<size_t>(inAlignment)); } \
^
/Users/jedumas/external/git/JoltPhysicsHelloWorld/Build/build/_deps/joltphysics-src/Build/../Jolt/Physics/Body/BodyID.h:15:2: note: candidate function not viable: requires single argument 'inCount', but 2 arguments were provided
/Users/jedumas/external/git/JoltPhysicsHelloWorld/Build/build/_deps/joltphysics-src/Build/../Jolt/Core/Memory.h:30:19: note: expanded from macro 'JPH_OVERRIDE_NEW_DELETE'
JPH_INLINE void *operator new (size_t inCount) { return JPH::Allocate(inCount); } \
^
1 error generated.
When compiling with JPH_DISABLE_CUSTOM_ALLOCATOR defined the error goes away.
The text was updated successfully, but these errors were encountered:
Hi,
I'm having some trouble using Jolt's overidden new/delete operators with a placement new syntax. Here is an example code:
Which compiles with the following error (Xcode15.3 on macOS, using Jolt 4.0.2):
When compiling with
JPH_DISABLE_CUSTOM_ALLOCATOR
defined the error goes away.The text was updated successfully, but these errors were encountered: