Hello Everyone,
I had this code working on DEV C++. But now, it does not work in Visual C++ Exress. Here is the code:
[code=cpp]
template <class V, class AI, class I, class S>
const V& AssocArray<V, AI, I, S>::operator [] (const AI& index) const
{
const_iterator it = internal_array. find(index);
V mapIndex = (*it).second;
return mapIndex;
}[/code]
I get the following warning:
warning C4172: returning address of local variable or temporary
It is not clear to me what this means. I would appreciate any help.
I had this code working on DEV C++. But now, it does not work in Visual C++ Exress. Here is the code:
[code=cpp]
template <class V, class AI, class I, class S>
const V& AssocArray<V, AI, I, S>::operator [] (const AI& index) const
{
const_iterator it = internal_array. find(index);
V mapIndex = (*it).second;
return mapIndex;
}[/code]
I get the following warning:
warning C4172: returning address of local variable or temporary
It is not clear to me what this means. I would appreciate any help.
Comment