
AMDG On 12/14/2010 6:49 AM, przemyslaw.sliwa@uk.bnpparibas.com wrote:
Could someone tell me why this code does not compile? Can it be modified in order to compile?
struct CcyCplEventKey { CurrencyCouple CcyCpl; EventType Event; }
typedef std::map<CurrencyEventKey, CurrencyEventPtr> mapType;
mapType ccyOut;
std::for_each(ccyOut.begin(), ccyOut.end(), (&*boost::lambda::_1)->*&CcyCplEventKey::Event);
boost::lambda::_1 gets replaced with an object of type std::pair<const CurrencyEventKey, CurrencyEventPtr>. a) std::pair can't be dereferenced. b) Even if it could be, you can't call a member function of CcyCplEventKey with a std::pair. c) Accessing a data member has no side-effects. The for_each doesn't do anything, so I don't know what you're trying to accomplish. In Christ, Steven Watanabe