30 Nov
2023
30 Nov
'23
4:02 p.m.
Andrey Semashev wrote:
I think a similar utility would be more useful in form of a class template, for example:
resource
windows_handle; resource sdl_window_handle;
That's
template
This would also prohibit resource types with non-constexpr constructors, as well as non-default-constructible resources. I don't like this tradeoff.
It doesn't. The two operations required from R are construction from Def and comparing to Def. https://godbolt.org/z/h7z3qGzvs Note that the type of Def doesn't have to be R.