#pragma once #include #include namespace JSON { // Use this instead of default json_object using Object = std::unique_ptr; // Use this instead of json_object_from_x. Pass the function and its arguments instead. template static inline JSON::Object NewObject(json_object *(*Function)(Args...), Args... Arguments) { return JSON::Object((*Function)(Arguments...), json_object_put); } } // namespace JSON