Why does JPH::Ref Exist #1490
Answered
by
jrouwe
cuppajoeman
asked this question in
Q&A
-
I understand how references work in c++, in that when passing by reference we won't copy the object but instead it behaves like a pointer, can you explain why you implemented custom |
Beta Was this translation helpful? Give feedback.
Answered by
jrouwe
Feb 5, 2025
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A smart pointer is a programming pattern. The standard library implements several types of smart pointers.
std::shared_ptr
is close to whatRef
does. I try to avoid using the standard library as much as possible as the implementation varies from platform to platform and the implementations often have performance pitfalls that are quite unintuitive.