0

So I have these 2 lines of code that refuse to compile:

vk::GraphicsPipelineCreateInfo pipeline_info();
device.createGraphicsPipeline({}, pipeline_info);

According to this example this should work. However the compiler complains:

error: no matching function for call to ‘vk::Device::createGraphicsPipeline(<brace-enclosed initializer list>, vk::GraphicsPipelineCreateInfo (&)())’
 device.createGraphicsPipeline({}, pipeline_info);

I don;t understand why this doesn't work, modifying the call to use unique initialization makes no difference.

Makogan
  • 8,208
  • 7
  • 44
  • 112

1 Answers1

1

This is the most-vexing parse:

vk::GraphicsPipelineCreateInfo pipeline_info();

You are declaring a function, not an object!

See e.g. My attempt at value initialization is interpreted as a function declaration, and why doesn't A a(()); solve it?

Acorn
  • 24,970
  • 5
  • 40
  • 69