Is it better to initialise members with recommended defaults such as
class PipelineBuilder {
public:
vk::FrontFace front_face{vk::FrontFace::eCounterClockwise};
vk::CullModeFlags{vk::CullModeFlagBits::eFront};
}
so that these values are set when the default constructor is called.
Or is it better to create a “default” function, and leave the default constructor to 0 initialise everything, for example:
class PipelineBuilder {
public:
vk::FrontFace front_face{};
vk::CullModeFlags{};
PipelineBuilder default(); // Return a builder with reasonable defaults
}
My goal is to make the builder usage as transparent and as least confusing as possible, without doing anything that might surprise the user.
2