In case of an error, I understand that you can return std :: nullopt, but when you return a specific value, it does not compile, VS2017 swears:

"fatal error C1189: #error: class template optional is only available with C ++ 17."

As I understand the studio still does not support this thing? Need to screw up?

  • one
    Firstly, to use C ++ 17 features in VS2017, you need to enable C ++ 17 in the project settings. Secondly, verbal stories "based on" about errors in the code are not interesting to anyone here. What kind of "good deal" is it not clear, too. - AnT 4:16 pm
  • If you need any additional information, say so, I will add. Now I will try your advice. Everything worked, thanks - Victor Sadovin
  • This is not a question of missing information, but superfluous. I combed your question, if you do not mind (if you mind, you can roll back the edit). - D-side

0