Make sure your project is set to use C++17:
Right-click your project in Solution Explorer.
Go to Properties → C/C++ → Language.
Set C++ Language Standard to ISO C++17 Standard (/std:c++17) or later.