i am doing the Vulkan Tutorial https://vulkan-tutorial.com/
#define GLFW_INCLUE_VULKAN
#include<GLFW/glfw3.h>
#include<optional>
struct s {
std::optional<uint32_t> num;//Intellisense Error
};
int main() {
return 5;
}
I started with an empty project and added includes and libraries; I can compile and run without including std::optional.
When i use std::optional I get c2039 "optional is not a member of std"
I am running Windows 10, and VisualStudio 2019
What is going on here ?
thx.
std::optional requires C++17.
Live on Godbolt.
you can use /std:c++17
flag on MSVC
and -std=c++17
on gcc/clang
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With