If you are having problems, read the error message carefully. For example, std::mem_fun can return all sorts of wrappers, depending on what you pass to it.

Or indeed, switch to boost's or C++0x's function.

Edit: With this particular error message, I assume that you are doing something that invokes the default constructor for contained type (e.g resize or specifying the size with the vector's constructor). You can't use those functions.

I really can't see why it would not work, but it's actually a pretty ugly solution. Just take vector<function<ReturnType(MyClass*)>> and be without those issues present in C++03 binders.

mem_fun_t meets the requirements to be stored in a container (it is copy-constructible and assignable), so the answer is yes.

However, it isn't default-constructible or comparable, so there are some things you can't do with a container of them, including:

Resizing, unless you provide a value to fill with

Constructing with a non-zero size, unless you provide a value to fill with

Comparing containers

The error you are seeing comes from trying to either resize, or construct with a size.

Related post

I am just getting started with NHibernate (for the 15th time it would seem) and am having the following problem. The following table: Table Facility Column FACILITY_ID integer Column NAME varchar2(50) Column MONTH varchar2(5) For whatever reason, mon

The question arises from the reply. How can I change the storing from an ISO-standard to UTF-8? Some details: I used Mac with some ISO-standard. I formatted it, so I cannot know the exact ISO-standard. Now, I use Ubuntu, and I try to switch my Mac-la

Should a value always be stored in a database using a specific unit (e.g. meters) or should the unit be settable using an additional field or table? Example 1: Unit defined as part of the field buildings ----------------------------- building_id INT

I am trying to convince someone that using an external DLL to manage sql data is better then using stored procedures. Currently the person I am working with is using vba and calls sql stored procedures to get the complicated data they need from many

I'm trying to make a set of classes to deal with localization (mostly the currency part, but also language). I can imagine how the logic could be, but I don't know what names to use for the different languages and currencies. I have seen there are ma

I'm trying to create a byte array whose size is of type long. For example, think of it as: long x = _________; byte[] b = new byte[x]; Apparently you can only specify an int for the size of a byte array. Before anyone asks why I would need a byte arr

How is the performance of ConcurrentHashMap compared to HashMap, especially .get() operation (I'm especially interested for the case of only few items, in the range between maybe 0-5000)? Is there any reason not to use ConcurrentHashMap instead of Ha

I have a servlet based application for serving stored documents and images. The images were all stored as jpg with standard sizes based on corporate standards at the time the system was designed. Now, the image sizes that users want to see have chang

I'm looking for answers to a few general questions as to how point of sale (POS) software and hardware generally works in brick-and-mortar stores. I realize there will be many edge cases given the sheer number of solutions out there, but I'm looking

So I'm looking at various key:value (where value is either strictly a single value or possibly an object) stores for use with Python, and have found a few promising ones. I have no specific requirement as of yet because I am in the evaluation phase.

Relevant Information on my system: Core2Duo T6500 gcc (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2) Using the basic set implementation, where each set that is stored is really just the lexicographical order of the set stored, you can use standard bit operat

It's possible to define your own custom templates for normal project types, such as templates for C# files, for a Class Library project. What about a 'Database Project' scenario? I would like to define a standard template for adding a stored procedur

I'm writing stored procs that are being called by a legacy system. One of the constraints of the legacy system is that there must be at least one row in the single result set returned from the stored proc. The standard is to return a zero in the firs

What can I use as a decimal type in JavaScript? It's not supported (0.1 + 0.2 !== 0.3), and I need it for representing exact values in a banking/financial application. See The State and Future of JavaScript for a good read and the dirty details behin

Some while ago I found a web page explaining the default size of a session was 2048 kb, the minimum was 1 kb. How can this be adjusted? And if some one has links regarding the subject I would be a happy camper :) Sorry not for mentioning the IIS, but

just came a across a situation where I needs to store heap-allocated pointers (to a class B) in an STL container. The class that owns the privately held container (class A) also creates the instances of B. Class A will be able to return a const point

I am using lucene for searching and with tags i use the whitespace analyzer. It looks like its stored properly. With standard analyzer my 'C#' search will yield results for C, C++. Every analyzer i tried (i havent tried all) does this except for whit