Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

Quick boost.lambda question

Started by load_bitmap_file Apr 1, 2006 at 11:03 PM 1 replies 650+ views
Original Post
load_bitmap_file
load_bitmap_file
If I have a container of abstract base pointers, what's the proper way to do this:
for_each(container.begin(), container.end(), bind(&Foo::fn, *_1));
? I'm trying to call Foo::fn() for every element of container but my compiler is complaining about being unable to instantiate the abstract class Foo.
load_bitmap_file
load_bitmap_file
Quote:
Original post by Anonymous Poster
for_each(container.begin(), container.end(), bind(&Foo::fn,_1, *_2));

for (nonstatic) member-functions the first parameter is always the object itself (the this-pointer so to say)


Thanks AP! [smile]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.