Std::map iterator issue

Please provide the following information:


ROOT Version (e.g. 5.34/36):
Platform, compiler (e.g. lxplus):


Trying to use std:map in my script by following the example outlined in this post:

However it looks like this example code is not working on lxplus with root version 5.34/36:


ROOT 5.34/36 (heads/v5-34-00-patches@v5-34-34-76-g57bae4c, Apr 08 2016, 12:05:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]
Processing root_test.cc…
Error: Symbol it is not defined in current scope root_test.cc:17:
Error: Failed to evaluate it->first
Error: Failed to evaluate it->first.first
Error: << Illegal operator for pointer 3 root_test.cc:17:
Error: Symbol it is not defined in current scope root_test.cc:17:
Error: Failed to evaluate it->first
Error: Failed to evaluate it->first.second
Error: << Illegal operator for pointer 3 root_test.cc:17:
Error: Symbol it is not defined in current scope root_test.cc:17:
Error: Failed to evaluate it->second
Error: Failed to evaluate it->second->GetTitle()
Error: << Illegal operator for pointer 3 root_test.cc:17:
*** Interpreter error recovered ***

With ROOT 5 you will probably need to use this macro as precompiled only, i.e. via ACLiC. Try:

root root_test.cc++
2 Likes

root root_test.cc++ works fine,thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.