self-referential boost functions
Inquiring as to whether this is possible or if there is a better pattern
for simulating this behavior...
Is it possible for boost::function to be self referential? I.e. how do I
simulate behavior like the following:
typedef boost::function
Adam Crain
Inquiring as to whether this is possible or if there is a better pattern for simulating this behavior...
Is it possible for boost::function to be self referential? I.e. how do I simulate behavior like the following:
typedef boost::function
Func; A function that does something mutable and then returns the next function to be called or an empty function.
Boost.Function still requires static typing on the return type and that
type depends on some runtime variable, so you cannot statically type it.
What might work:
#include
On Thu, 28 Jun 2012, Philipp Moeller wrote:
Adam Crain
writes: Inquiring as to whether this is possible or if there is a better pattern for simulating this behavior...
Is it possible for boost::function to be self referential? I.e. how do I simulate behavior like the following:
typedef boost::function
Func; A function that does something mutable and then returns the next function to be called or an empty function.
Boost.Function still requires static typing on the return type and that type depends on some runtime variable, so you cannot statically type it.
What about something like:
struct t: boost::function
participants (3)
-
Adam Crain
-
Jeremiah Willcock
-
Philipp Moeller