From 0a84a4ebb304a64da1fea8d34719a94be54ff61d Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 1 Sep 2017 13:12:11 +1000 Subject: [PATCH] object: briefly comment the enumerate method --- object.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object.cpp b/object.cpp index e9b219e..abc015a 100644 --- a/object.cpp +++ b/object.cpp @@ -77,13 +77,16 @@ VK_INSTANTIATED_TYPE_MAP (INSTANTIATED) template std::vector cruft::vk::enumerated::find (const instance &inst) { + // find the total number of objects uint32_t expected = 0; error::try_code (enum_traits::enumerate (inst.id (), &expected, nullptr)); + // allocate an array of handles and fetch them uint32_t found = expected; typename T::id_t handles[expected]; error::try_code (enum_traits::enumerate (inst.id (), &found, handles)); + // return an collection of objects from the handles return std::vector (handles, handles + found); }