ColinPitrat / caprice32

An emulator of the Amstrad CPC 8bit home computer range.
GNU General Public License v2.0
146 stars 32 forks source link

memutils introduction proposal. #215

Closed devnexen closed 1 year ago

devnexen commented 2 years ago

starting with a scoped callback e.g. when it would become too verbose to close resources for each error case.

ColinPitrat commented 2 years ago

There's scope_exit in experimental: https://en.cppreference.com/w/cpp/experimental/scope_exit

I guess we could start using it, not sure how far it is from making it to the standard.

devnexen commented 2 years ago

looks interesting but I do not have it in my compilers I have the experimental namespace tough.

ColinPitrat commented 1 year ago

I'd be happy to merge this if we rename deref to scope_exit which seems to be what the standard is currently considering as well as what boost uses.