I have code below and it reports "auto is not allowed here"
//GeSettings() returns boost::optional<ValueType> and could be empty
if((auto ret = GetSettings(InputField)) && ShouldWeDoThis())
{
do something with ret;
}
but changing as below if fine.
if(auto ret = GetSettings(InputField))
{
if(ShouldWeDoThis())
{
do something with ret;
}
}
The reason behind could be silly buy may I ask why? I am using Visual Studio 2017