jeudi 30 janvier 2020

Use std::find with stride and only check specific member in struct

layers stores a lot of members, like each element's name:

std::vector<vk::LayerProperties> layers = vk::enumerateInstanceLayerProperties()

layerNames only stores the name of each layer:

std::vector<const char*> layerNames(layers.size());

I copy the name member from each layer element into layerNames, and then use std::find on layerNames.

Is there a way to use std::find on layers directly and use a stride to only check the name member when iterating?

Aucun commentaire:

Enregistrer un commentaire