Abdelrazak Younes wrote: > Georg Baum wrote: >> a) The nonconst Buffer::errorList can be shortened a lot, > > I was not sure that the missing entry would be automatically inserted so > I went for the safest road. If this is standard compliant I guess MSVC > will be OK with that.
This is standard behaviour of std::map. The non-const operator[] inserts the element if it is not there. If you have been bitten by it once you won't forget... >> b) the for_each construct works with boost::bind, we use this at other >> places. mem_fun_ref calls a member function of the container element, but >> what we need is a member function of the LyX class. > > Interesting, I shall read the boost bind doc sometimes. FYI, the > standard doc says to use mem_fun_ref, if somebody knows what's wrong > with the formerly commented code, I'd be interested to know. Example: class Foo { void Fun(Foo const &); }; class Bar { void DoSomething(); void Fun(Foo const &); }; Bar::DoSomething() { std::vector<Foo> x; for_each(x.begin(), x.end(), std::mem_fun_ref(&Foo::Fun)); for_each(x.begin(), x.end(), boost::bind(&Bar::Fun, this, _1)); } The case we have here is the second. Clear now? Georg