Вот такой код:
#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
std::set<const char*> notSupportedExtensionsNames;
for (auto& extensionName : requiredExtensionsNames) {
notSupportedExtensionsNames.insert(extensionName);
}
for (auto& extension : supportedExtensions) {
if (!strcmp(extension.extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME)) {
std::cout << "try erase " << "\"" << VK_KHR_SWAPCHAIN_EXTENSION_NAME << " \"" << "from notSupportedExtensionsNames\n";
std::cout << "count: " << notSupportedExtensionsNames.count(VK_KHR_SWAPCHAIN_EXTENSION_NAME) << std::endl;
std::cout << "strcmp: " << strcmp(extension.extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) << std::endl;
std::cout << "count: " << notSupportedExtensionsNames.count(extension.extensionName) << std::endl;
}
notSupportedExtensionsNames.erase(extension.extensionName);
}
И такой очень забавный вывод:
count: 1
strcmp: 0
count: 0
Как это понимать?
VK_KHR_SWAPCHAIN_EXTENSION_NAME в сете он находит, а extension.extensionName он не находит, при условии что они равны) Просвятите?