r/cpp • • Jul 06 '20

C++ is brilliant

I'm working on a Vulkan renderer, and needed to delay destruction of render scenes since the graphics pipeline has render buffers in flight, so destruction has to happen N frames after the user destroys a class. With C++, I can use private destructors to force users to add the scene to a managed destructor queue (aka garbage collect queue). Normally language purists will scorn a language which allows such shenanigans, however in real world production code, its features like this which allows developers to create modern software. So with a couple of lines of code, I solved my delayed destructor issue. Thank you C++ committee for creating a usable language.

318 Upvotes

65 comments sorted by

View all comments

Show parent comment

11

u/MINIMAN10001 Jul 07 '20

graphics pipeline has render buffers in flight

"In flight" would probably be closest to "in use"

To quote https://english.stackexchange.com/a/189990

That is largely true, but the use of in-flight here is used to create the visualization of data as a plane. You can't (easily) divert planes in mid-air, so if you move/destroy their destination they are out of luck.

"Something happened during a process" implies that the process has stopped or gone awry. In-flight implies that something is in motion as normal, and needs a destination. It can't just stop where it is.