Re: Passing around a list of differently typed functions

2014-06-23 Thread Tobias Pankrath via Digitalmars-d-learn
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a, int b); bool bar(bool a, bool b); into

Re: Passing around a list of differently typed functions

2014-06-23 Thread FreeSlave via Digitalmars-d-learn
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a, int b); bool bar(bool a, bool b); into

Re: Passing around a list of differently typed functions

2014-06-23 Thread Bienlein via Digitalmars-d-learn
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a, int b); bool bar(bool a, bool b); into

Re: Passing around a list of differently typed functions

2014-06-23 Thread Alix Pexton via Digitalmars-d-learn
On 23/06/2014 8:19 AM, Bienlein wrote: On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a, int

Re: Passing around a list of differently typed functions

2014-06-23 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2014 11:32 PM, FreeSlave wrote: On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a,

Re: Passing around a list of differently typed functions

2014-06-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On Mon, 23 Jun 2014 14:30:12 -0400, Ali Çehreli acehr...@yahoo.com wrote: On 06/22/2014 11:32 PM, FreeSlave wrote: On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote: As the subject says, I would like to pass around an array of functions. The trick is, that the functions have

Passing around a list of differently typed functions

2014-06-22 Thread Evan Davis via Digitalmars-d-learn
As the subject says, I would like to pass around an array of functions. The trick is, that the functions have different type signatures. Is there a way to put the two functions int foo(int a, int b); bool bar(bool a, bool b); into one array, that I can pass around and cast as necessary?