Skip to content

Inconsistent vector type declaration #125

@SaschaWillems

Description

@SaschaWillems

Some places of the new tutorial seem to use some sort of auto-deduction for vectors, that allows you to skip the type declaration:

const std::vector validationLayers = {
    "VK_LAYER_KHRONOS_validation"
};

Other places do specify types:

    std::vector<const char*> requiredDeviceExtension = {
        vk::KHRSwapchainExtensionName,
        vk::KHRSpirv14ExtensionName,
        vk::KHRSynchronization2ExtensionName,
        vk::KHRCreateRenderpass2ExtensionName
    };

This is an inconsistency. The auto deduction for vectors is also something not a lot of developers know about and even some C++20 compilers seem to have issues. That leads people to think our code is wrong.

We should decide on a consistent way of declaring vectors. For clarity I'm for explicitly stating types.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions