0

I asked this question earlier:

Passing C++ functions as arguments without function pointer/inlined?

where I wanted to pass a function as an argument. However, the function being passed will require arguments itself, which are only determined at run-time, shortly before the lambda is actually invoked.

I need a way to decide which function to pass in very early on, with the ability for the lambda's arguments to be chosen later on shortly before invoccation?.

Is this possible?

(I cannot use command pattern because there's too much use of polymorphism. I have performance requirements)

Community
  • 1
  • 1
user997112
  • 29,025
  • 43
  • 182
  • 361
  • Do you mean like passing a `std::function`? – Barry Nov 24 '14 at 14:18
  • 1
    You seem somewhat confused. You are using lambda and function seemingly interchangeably. I suspect you need to be more concrete to describe your problem, which isn't surprising: if you knew how to abstract a problem, often the solution falls out. Can you give an actual concrete description of the problem you are trying to solve (and not just the sub-problem you are working on and have stumbled over)? – Yakk - Adam Nevraumont Nov 24 '14 at 14:29

0 Answers0