How to make handles to cube class both thread safe and efficient? #419
Labels
feat:concurrency
multithreading, asynchronous events, concurrency
feat:octree
octree, cube computations
org:discussion
needs further discussion with others
We are passing around a lot of pointers, smart pointers or const references to cubes in our code. This is necessary, as it's a major part of our engine. For example I'm working on the new octree collision (see upcoming pull request later) which looks like this:
So in this code I am passing the cube as std::shared_ptr. This is fine, but clang-tidy suggests to pass it as const reference to a shared pointer. Jason Turner and Scott Meyers however say that this is not a good idea.
We have the following options:
std::shared_ptr
std::weak_ptr
Notes:
I think this is a common question which will is relevant for many code parts.
What do you guys propose?
The text was updated successfully, but these errors were encountered: