Bug 16744 – We should have a TypeOf template so that typeof can be used with templates like staticMap

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-23T21:56:01Z
Last change time
2018-01-05T13:37:49Z
Assigned to
No Owner
Creator
Jonathan M Davis

Comments

Comment #0 by issues.dlang — 2016-11-23T21:56:01Z
Unfortunately, there is no way to do the compile-time equivalent of a lambda when dealing with templates. So, you can't use do something like staticMap!(a => typeof(a), args) or whatever the syntax would be if we had it. So, we need a helper template to do the same thing if we want to use typeof with something like staticMap. e.g. staticMap!(TypeOf, args) It seems to me that it makes sense to add such a helper to Phobos rather than requiring that everyone do it themselves when they need it.
Comment #1 by john.loughran.colvin — 2016-12-08T01:43:57Z
A more general alternative might be to (and brace yourself because you're probably not gonna like it) introduce string template lambdas. staticMap!(`a.sizeof`, args); staticMap!(q{typeof(a)}, args);
Comment #2 by github-bugzilla — 2017-07-29T00:52:38Z
Commit pushed to MetaLang-patch-1 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/dfc27ab93fd565de041fc310c622d336458b24a1 Fix Issue #16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #3 by github-bugzilla — 2017-07-29T01:01:54Z
Commit pushed to MetaLang-patch-1-2 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0999d29133b7ba9be9957cdf0c64a3ba4d5839f4 Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #4 by github-bugzilla — 2017-07-29T01:03:35Z
Commit pushed to MetaLang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/e916dc248bf82789e5032a8dd0daab4004434a5c Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #5 by github-bugzilla — 2017-07-29T01:33:11Z
Commit pushed to Metalang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/eb1ace49a396d24bc21f21e84ecc9bf2a8909d08 Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #6 by github-bugzilla — 2017-07-29T01:45:51Z
Commit pushed to Metalang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/67e6e3afc87700364cbc96ddc7deb87115d37c62 Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #7 by github-bugzilla — 2017-07-29T01:48:42Z
Commit pushed to MetaLang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b26f48c2000762b992789e6e211bf842ec4a6579 Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #8 by github-bugzilla — 2017-07-29T02:04:04Z
Commit pushed to MetaLang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/53d491121642e0f342b0611fc3d8649c66ef5ed8 Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #9 by github-bugzilla — 2017-07-29T02:05:22Z
Commit pushed to MetaLang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d39cc3ff43501a753c14dc1d7461603dc77640ba Fix Issue 16744: Add Typeof This an alternative implementation to https://github.com/dlang/phobos/pull/4920
Comment #10 by github-bugzilla — 2017-07-31T16:16:01Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d39cc3ff43501a753c14dc1d7461603dc77640ba Fix Issue 16744: Add Typeof https://github.com/dlang/phobos/commit/674f87e061ad55a2a2d312b099d32e58404d92ab Merge pull request #5662 from dlang/MetaLang-patch-1-3 Fix Issue 16744: Add Typeof merged-on-behalf-of: Stefan Koch <[email protected]>
Comment #11 by github-bugzilla — 2017-07-31T18:50:38Z
Commit pushed to revert-5662-MetaLang-patch-1-3 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/be351ebe20df55b72e7441e43b84cfacee42f8ea Revert "Fix Issue 16744: Add Typeof"
Comment #12 by github-bugzilla — 2017-07-31T23:12:43Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/be351ebe20df55b72e7441e43b84cfacee42f8ea Revert "Fix Issue 16744: Add Typeof" https://github.com/dlang/phobos/commit/f0eaf4456355f3ed68e4fe078663fbb7ccaf46de Merge pull request #5664 from dlang/revert-5662-MetaLang-patch-1-3 Revert "Fix Issue 16744: Add Typeof" merged-on-behalf-of: MetaLang <[email protected]>
Comment #13 by github-bugzilla — 2017-08-16T13:24:25Z
Comment #14 by github-bugzilla — 2017-10-18T11:33:53Z
Commit pushed to MetaLang-traits-typeof at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/e6d1fc25e55612d513ff0b27893d1dd40642f884 Fix Issue 16744: Add Typeof (Redux) Previous PR: https://github.com/dlang/phobos/pull/5662. I'm resubmitting this after it was reverted in https://github.com/dlang/phobos/pull/5664. This an alternative implementation to #4920.
Comment #15 by monkeyworks12 — 2017-10-23T18:08:57Z
Rejected by Andrei, so I'm closing this.
Comment #16 by github-bugzilla — 2018-01-05T13:30:47Z