cpp::scoped_resource: RAII resource management for non-RAII-ready resources