I have the following line of code which works great:
const auto& dict = m_DictionaryAbbreviationsAndEnglish.Content;
Now I wanted to introduce an "if-then" clause, but the compiler tells me "Can't deduce 'auto' type (initalizer required):
const auto& dict;
if (uSkipAbbreviationsAndEnglish)
{
dict = m_DictionaryNoAbbreviationsNoEnglish.Content();
}
else
{
dict = m_DictionaryAbbreviationsAndEnglish.Content();
}
However, when I initialize it like this...
const auto& dict=NULL;
..., I'm unable to assign "dict" using such code:
dict = m_DictionaryNoAbbreviationsNoEnglish.Content();
The error is "Expression must be a modifiable lValue."
Can anybody tell me how to do this correctly?
Thank you.
ps: Content is this:
map<wstring,wstring> &clsTranslations::Content()
{
return m_content;
}