asmyatt
asked on
Problem reading iterator values from a set
I am porting some windows C++ code to solaris. The following line of code compiles and works on the windows maching, but not the solaris machine.
I get the following error message:
error: invalid initialization of reference of type 'std::set<std::wstring, std::less<std::wstring>, std::allocator<std::wstrin g> >&' from expression of type 'const std::set<std::wstring, std::less<std::wstring>, std::allocator<std::wstrin g> >'
Can anyone shed some light on this? I don't see what the problem is.
I get the following error message:
error: invalid initialization of reference of type 'std::set<std::wstring, std::less<std::wstring>, std::allocator<std::wstrin
Can anyone shed some light on this? I don't see what the problem is.
set< pair< long,set<wstring> > >::iterator itSet1;
set<wstring> &tempSet = (*itSet1).second;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
const set<wstring> &tempSet = (*itSet1).second;
and you should be fine (according to the error message).