From 9fe6b2384e75bf351234357e2c603992de8c511d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Wed, 11 May 2016 11:07:04 +0200 Subject: [PATCH] Added nullptr_t-constructor to ArrayProxy, simplifying handling of empty arrays. --- VkCppGenerator.cpp | 5 +++++ vulkan/vk_cpp.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/VkCppGenerator.cpp b/VkCppGenerator.cpp index 9e1b8ee..54a05a4 100644 --- a/VkCppGenerator.cpp +++ b/VkCppGenerator.cpp @@ -238,6 +238,11 @@ std::string const arrayProxyHeader = ( " class ArrayProxy\n" " {\n" " public:\n" + " ArrayProxy(std::nullptr_t)\n" + " : m_count(0)\n" + " , m_ptr(nullptr)\n" + " {}\n" + "\n" " ArrayProxy(T & ptr)\n" " : m_count(1)\n" " , m_ptr(&ptr)\n" diff --git a/vulkan/vk_cpp.hpp b/vulkan/vk_cpp.hpp index 9313f5a..65327b4 100644 --- a/vulkan/vk_cpp.hpp +++ b/vulkan/vk_cpp.hpp @@ -220,6 +220,11 @@ namespace vk class ArrayProxy { public: + ArrayProxy(std::nullptr_t) + : m_count(0) + , m_ptr(nullptr) + {} + ArrayProxy(T & ptr) : m_count(1) , m_ptr(&ptr)