Is there a proper ‘ownership-in-a-package’ for ‘handles’ available?

The type unique_ptr is less general than the phrase “handle”, yes. But why shouldn’t it be? Just one of your “handle” examples (say, the one that is an integer index), is precisely as general as unique_ptr. You can’t compare one specific kind of handle with “all handles ever”.

If you want a single, concrete C++ type (or type template) that is a handle without actually defining any specific handling semantics then… I can’t help you. I don’t think anyone tractibly could.

Leave a Comment