ilansch
ilansch

Reputation: 4878

MFC C++ lookup on CMAP

When I use a .lookup(key, value) on a project member MFC CMap.
Does the return value, is by reference ?

Template:

CMap<ID_TYPE, ID_TYPE, CSimulatedRule, CSimulatedRule&> m_SimulatedRules;

If i edit value members, e.g value.setAge(10); will it change the value on Map ? or just the value object that I currently have ?

Code:

CSimulatedRule simulatedRule;
m_SimulatedRules.Lookup(ro.Id(),simulatedRule);  

When editing simulatedRule it will edit the object on the CMap?

Upvotes: 1

Views: 2065

Answers (1)

ilansch
ilansch

Reputation: 4878

This will not change the object in map. Use PLookup instead.

Upvotes: 1

Related Questions