On Monday, 29 March 2021 at 17:52:13 UTC, Gavin Ray wrote:
Trying to read this function signature:
void my_func(T, XS)(string a, string b, string c, lazy T
function(XS)[] t...)
Does this say "Generic void function 'my_func', which takes two
generic/type params "T" and "XS", and is a
On Monday, 29 March 2021 at 17:02:40 UTC, evilrat wrote:
Also with delegates (lazy), you get the type checks however you
must have to declare parameters on call site, which can be PITA
in the future when doing refactoring will be necessary.
Better plan ahead as the number of changes will
On Monday, 29 March 2021 at 16:31:49 UTC, Paul Backus wrote:
On Monday, 29 March 2021 at 16:20:59 UTC, Ali Çehreli wrote:
auto myFunc(F)(string name, F func)
{
// This condition could be a template constraint but they
don't
// support error messages.
static assert (is (Parameters!func
On Monday, 29 March 2021 at 15:13:04 UTC, Gavin Ray wrote:
Brief question, is it possible to write this so that the "alias
fn" here appears as the final argument?
auto my_func(alias fn)(string name, string description, auto
otherthing)
The above seems to work, since the type of "fn" can
On Monday, 29 March 2021 at 16:20:59 UTC, Ali Çehreli wrote:
auto myFunc(F)(string name, F func)
{
// This condition could be a template constraint but they
don't
// support error messages.
static assert (is (Parameters!func == AliasSeq!(string)),
"'func' must be a
On 3/29/21 8:13 AM, Gavin Ray wrote:
> Brief question, is it possible to write this so that the "alias fn" here
> appears as the final argument?
>
>auto my_func(alias fn)(string name, string description, auto
otherthing)
Yes, as a type template parameter but you would have to constrain