On Fri, Nov 5, 2010 at 7:08 AM, <Nick.Adamson@generaldynamics.uk.com> wrote:

As the result of boost::bind is a template I don't know of an stl or boost container which will store these objects.
As there are a number of functions that can be called on my resource with differing arguments I don't think I can use a boost::function as I don't know the arguments to my generic post call.

I think boost::function<void()> may be exactly what you want. The usage would be to boost::bind() your function with all the desired argument values: I'm assuming you already know these before you decide whether the resource is ready to service the function call. Then you can simply call the resulting object with no additional arguments. Everything it needs is already bound.

Then it's easy to decide whether to call it immediately, or put it in a std::queue< boost::function<void()> >.