[Issue 9591] std.typetuple.staticApplyMap

2020-03-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

Basile-z  changed:

   What|Removed |Added

 CC|b2.t...@gmx.com |

--


[Issue 9591] std.typetuple.staticApplyMap

2017-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

--- Comment #7 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/f3cec8bdd38529848c5c1bed1f5a2a9817e07203
Fix issue 9591 - Allow Instantiate template to be public, give example

https://github.com/dlang/phobos/commit/efae08503d9a83d6abdf29270e4c363c393e53de
Merge pull request #5739 from schveiguy/fix9591

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

--- Comment #6 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/f3cec8bdd38529848c5c1bed1f5a2a9817e07203
Fix issue 9591 - Allow Instantiate template to be public, give example
of how Instantiate + ApplyRight can be used to solve the problem.

https://github.com/dlang/phobos/commit/efae08503d9a83d6abdf29270e4c363c393e53de
Merge pull request #5739 from schveiguy/fix9591

Fix issue 9591 - Allow Instantiate template to be public

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

--- Comment #5 from Steven Schveighoffer  ---
As David Nadlinger pointed out, this can already be solved with Instantiate and
ApplyRight. I added a PR to make Instantiate public, and add the solution to
this issue as a documented unit test.

https://github.com/dlang/phobos/pull/5739

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

Steven Schveighoffer  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #4 from Steven Schveighoffer  ---
PR: https://github.com/dlang/phobos/pull/5738

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

--- Comment #3 from Steven Schveighoffer  ---
(In reply to Steven Schveighoffer from comment #2)
> Is there an "Instantiate"
> template that could be used in place of ApplyLeft inside the ApplyWith
> template? That might be more proper.

There is, it's just private:
https://github.com/dlang/phobos/blob/master/std/meta.d#L1670

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

Steven Schveighoffer  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||schvei...@yahoo.com
 Resolution|WONTFIX |---

--- Comment #2 from Steven Schveighoffer  ---
std.typetuple was moved to std.meta, so the request is still valid.

We have ApplyLeft and ApplyRight, which take a template as the first parameter,
and combined with staticMap, could work as long as the parameters are reversed
(the template comes last). Having something that applies a single parameter (or
even multipe ones) to a list of templates would be useful as well, and is
difficult to do directly.

However, I don't think we need a specific function, a helper like this would
work:

template ApplyWith(Args...)
{
   alias ApplyWith = ApplyLeft!(Args[$-1], Args[0 .. $-1]);
}

alias T = staticMap!(ApplyLeft!(ApplyWith, string), leftJustify, center,
rightJustify);

void main()
{
   foreach(f; T)
  writeln(f("hello", 20));
}

It's not perfect. The resulting T isn't a tuple of instantiated templates, it's
a tuple of ApplyLeft aliases, awaiting instantiation.

But a helper like the above would be useful. Is there an "Instantiate" template
that could be used in place of ApplyLeft inside the ApplyWith template? That
might be more proper.

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #1 from b2.t...@gmx.com ---
std.typetuple doesn't exist anymore and the idea had never been expressed in a
pull request.

--


[Issue 9591] std.typetuple.staticApplyMap

2017-09-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9591

b2.t...@gmx.com changed:

   What|Removed |Added

 CC||b2.t...@gmx.com

--