boost for each problem

Posted by areslp on Stack Overflow See other posts from Stack Overflow or by areslp
Published on 2010-06-07T14:27:54Z Indexed on 2010/06/07 14:32 UTC
Read the original article Hit count: 310

Filed under:
|
|
std::map< std::string , std::string > matrix_int;
typedef std::pair< std::string , std::string > lp_type;
BOOST_FOREACH( lp_type &row, matrix_int ){

}

this can not be complied: error C2440: 'initializing' : cannot convert from 'std::pair<_Ty1,_Ty2>' to 'lp_type &'

when I have ',' in element type, boost doc says I can use typedef or predefine a var; but what should I do when I want to get a reference?

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost