digitalmars.D - Why is this?
- Manu via Digitalmars-d (15/15) Sep 05 2016 I have weird thing:
- rikki cattermole (2/17) Sep 05 2016
- Manu via Digitalmars-d (3/15) Sep 05 2016 == double ?? Not sure what you're saying.
- rikki cattermole (15/31) Sep 05 2016 Basically your code only it is using typeof to get the type after all K
- rikki cattermole (14/46) Sep 05 2016 *sigh* I'm not thinking right that alias is template argument alias not
- Timon Gehr (2/17) Sep 06 2016 Bug.
- Manu via Digitalmars-d (3/29) Sep 06 2016 https://issues.dlang.org/show_bug.cgi?id=16472
I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {} S!float x; // Error: E!double.K is used as a type alias T = E!double.K; struct S2(F = float, alias e_ = T) {} S2!float y; // alias makes it okay... struct S3(F = float, alias e_ = (E!double.K)) {} S3!float z; // just putting parens make it okay as well... wat!? This can't be right... right? No problem if E is not a template.
Sep 05 2016
On 06/09/2016 6:07 PM, Manu via Digitalmars-d wrote:I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {}typeof(E!double.K)S!float x; // Error: E!double.K is used as a type alias T = E!double.K; struct S2(F = float, alias e_ = T) {} S2!float y; // alias makes it okay... struct S3(F = float, alias e_ = (E!double.K)) {} S3!float z; // just putting parens make it okay as well... wat!? This can't be right... right? No problem if E is not a template.
Sep 05 2016
On 6 September 2016 at 16:10, rikki cattermole via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 06/09/2016 6:07 PM, Manu via Digitalmars-d wrote:== double ?? Not sure what you're saying.I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {}typeof(E!double.K)
Sep 05 2016
On 06/09/2016 6:23 PM, Manu via Digitalmars-d wrote:On 6 September 2016 at 16:10, rikki cattermole via Digitalmars-d <digitalmars-d puremagic.com> wrote:Basically your code only it is using typeof to get the type after all K is a value and alias is for types. template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = typeof(E!double.K)) { pragma(msg, e_); // E pragma(msg, E!double.K); // 1.0 pragma(msg, typeof({return E!double.K;}())); // E } S!float x; But yes little weird.On 06/09/2016 6:07 PM, Manu via Digitalmars-d wrote:== double ?? Not sure what you're saying.I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {}typeof(E!double.K)
Sep 05 2016
On 06/09/2016 6:42 PM, rikki cattermole wrote:On 06/09/2016 6:23 PM, Manu via Digitalmars-d wrote:*sigh* I'm not thinking right that alias is template argument alias not alias of types. template E(F){ enum E { K = F(1) } } struct S(F = float, V=E!double, V e_ = V.K) { pragma(msg, e_); // E pragma(msg, E!double.K); // 1.0 pragma(msg, typeof({return E!double.K;}())); // E } S!float x;On 6 September 2016 at 16:10, rikki cattermole via Digitalmars-d <digitalmars-d puremagic.com> wrote:Basically your code only it is using typeof to get the type after all K is a value and alias is for types. template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = typeof(E!double.K)) { pragma(msg, e_); // E pragma(msg, E!double.K); // 1.0 pragma(msg, typeof({return E!double.K;}())); // E } S!float x; But yes little weird.On 06/09/2016 6:07 PM, Manu via Digitalmars-d wrote:== double ?? Not sure what you're saying.I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {}typeof(E!double.K)
Sep 05 2016
On 06.09.2016 08:07, Manu via Digitalmars-d wrote:I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {} S!float x; // Error: E!double.K is used as a type alias T = E!double.K; struct S2(F = float, alias e_ = T) {} S2!float y; // alias makes it okay... struct S3(F = float, alias e_ = (E!double.K)) {} S3!float z; // just putting parens make it okay as well... wat!? This can't be right... right? No problem if E is not a template.Bug.
Sep 06 2016
On 6 September 2016 at 21:28, Timon Gehr via Digitalmars-d <digitalmars-d puremagic.com> wrote:On 06.09.2016 08:07, Manu via Digitalmars-d wrote:https://issues.dlang.org/show_bug.cgi?id=16472I have weird thing: template E(F){ enum E { K = F(1) } } struct S(F = float, alias e_ = E!double.K) {} S!float x; // Error: E!double.K is used as a type alias T = E!double.K; struct S2(F = float, alias e_ = T) {} S2!float y; // alias makes it okay... struct S3(F = float, alias e_ = (E!double.K)) {} S3!float z; // just putting parens make it okay as well... wat!? This can't be right... right? No problem if E is not a template.Bug.
Sep 06 2016