Make sure you add the following at the top of your code:
#include <optional>
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Folks:
Developing with Visual Studio, updated today to version 17.4.4.
I'm starting the Vulkan tutorial and I'm stuck at:
https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Physical_devices_and_queue_families
struct QueueFamilyIndices {
Apparently the code block will only display one line so I'll complain again about how much I hate this forum software, I love and appreciate you guys and gals, and how much I prefer the one that was used by MSDN.
And here's the code I can't display in the code block:
**struct QueueFamilyIndices {
std::optional<uint32_t> graphicsFamily;
bool isComplete() {
return graphicsFamily.has_value();
}
};**
The errors are on the std::optional statement.
error C2039: 'optional': is not a member of 'std'
error C7568: argument list missing after assumed function template 'optional'
Here's Project Properties -> C++ -> Language:
I've tried different C++ Language Standard, Conformance mode and even C Language Standard, with no effect.
https://en.cppreference.com/w/cpp/utility/optional shows a c++17 compliant compiler should be able to handle std::optional.
What am I doing wrong?
Thanks
Larry
Make sure you add the following at the top of your code:
#include <optional>