diff --git a/src/blue_noise.cpp b/src/blue_noise.cpp index 2e1292e..ffdec72 100644 --- a/src/blue_noise.cpp +++ b/src/blue_noise.cpp @@ -456,8 +456,8 @@ image::Bl dither::blue_noise(int width, int height, int threads, // create compute pipeline. VkPipelineLayout compute_pipeline_layout; VkPipeline compute_pipeline; - utility::Cleanup cleanup_pipeline_layout(utility::Cleanup::Nop{}); - utility::Cleanup cleanup_pipeline(utility::Cleanup::Nop{}); + utility::Cleanup cleanup_pipeline_layout{}; + utility::Cleanup cleanup_pipeline{}; { VkShaderModuleCreateInfo shader_module_create_info{}; shader_module_create_info.sType = @@ -549,8 +549,8 @@ image::Bl dither::blue_noise(int width, int height, int threads, VkBuffer precomputed_buf; VkDeviceMemory precomputed_buf_mem; - utility::Cleanup cleanup_precomputed_buf(utility::Cleanup::Nop{}); - utility::Cleanup cleanup_precomputed_buf_mem(utility::Cleanup::Nop{}); + utility::Cleanup cleanup_precomputed_buf{}; + utility::Cleanup cleanup_precomputed_buf_mem{}; { VkBuffer staging_buffer; VkDeviceMemory staging_buffer_mem; @@ -647,8 +647,8 @@ image::Bl dither::blue_noise(int width, int height, int threads, VkBuffer other_buf; VkDeviceMemory other_buf_mem; - utility::Cleanup cleanup_other_buf(utility::Cleanup::Nop{}); - utility::Cleanup cleanup_other_buf_mem(utility::Cleanup::Nop{}); + utility::Cleanup cleanup_other_buf{}; + utility::Cleanup cleanup_other_buf_mem{}; { VkBuffer staging_buffer; VkDeviceMemory staging_buffer_mem; diff --git a/src/utility.cpp b/src/utility.cpp index ea72296..ea08093 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -3,7 +3,7 @@ utility::Cleanup::Cleanup(std::function fn, void *ptr) : fn(fn), ptr(ptr) {} -utility::Cleanup::Cleanup(Nop) : fn(), ptr(nullptr) {} +utility::Cleanup::Cleanup() : fn(), ptr(nullptr) {} utility::Cleanup::~Cleanup() { if (this->fn.has_value()) { diff --git a/src/utility.hpp b/src/utility.hpp index fe152bd..c9fa5ae 100644 --- a/src/utility.hpp +++ b/src/utility.hpp @@ -33,10 +33,8 @@ inline float dist(int a, int b, int width) { class Cleanup { public: - struct Nop {}; - + Cleanup(); Cleanup(std::function fn, void *ptr); - Cleanup(Nop nop); ~Cleanup(); // allow move