www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D's limited template specialization abilities compared to C++

reply "Ahuzhgairl" <bulletproofchest gmail.com> writes:
Hi,

In D, the : in a template parameter list only binds to 1 
parameter.
There is no way to specialize upon the entire template parameter 
list.
Therefore you can't do much with the pattern matching and it's 
not powerful.
Not a reasonable situation for a language aiming to be only the 
best.

What is needed is the ability to bind to the whole template 
parameter list:

template <class> struct get_class;
template <class R, class C, class... A> struct get_class<R 
(C::*)(A...)> { typedef C type; };

Let's shorten the terms:

<R, C, A...>   <R (C::*)(A...)>

And here's how this kind of specialization would work in D:

template A[B] { struct C {} } template Foo[alias X, Y, Z   
X[Y].Z] { alias Z Foo; } void main() { alias Foo[A[bool].C] xxx; }

You need a separate delimiter besides : which does not bind to 
individual parameters, but which binds to the set of parameters.

I propose   as the character which shall be the delimiter for the 
arguments to the pattern match, and the pattern match.

On an unrelated note, I don't like the ! thing so I use []. Sorry 
for the confusion there.

z
May 25 2013
next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
By extension,

template Foo[X, Y, Z   X[Y], Y[Z]] { alias Y Foo; }
May 25 2013
prev sibling next sibling parent reply "Peter Alexander" <peter.alexander.au gmail.com> writes:
Is this what you're looking for?

struct Foo(T)
{
	static void bar() { writeln("general"); }
}

struct Foo(T : A[B], A, B)
{
	static void bar() { writeln("special"); }
}

void main()
{
	Foo!(int).bar(); // general
	Foo!(int[int]).bar(); // special
}
May 25 2013
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 05/26/2013 03:04 PM, Andrej Mitrovic wrote:
 On 5/26/13, Kenji Hara <k.hara.pg gmail.com> wrote:
 Hmm. Currently D can specify specType for alias template parameter.

 struct X(alias int x) {}   // matches only when the symbol x has the type int

This feature is news to me! Pretty cool.

I'm about 3/4 through a D frontend implementation and was unaware of this. :) The reason is that the feature is undocumented. (The grammar specification mentions the syntax, though.)
  Philippe Sigaud: Is this mentioned in the D Template book?

I don't think so.
May 26 2013
prev sibling next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
No,




struct Foo(T) {
     static void f() { writeln("general"); }
}

struct Foo(T : A(B).alias C, A, B, C) {
     static void f() { writeln("special"); }
}

struct Bar(T) {
     struct Baz {}
}

struct Baz(T : A(B), A, B) {
}

void main() {
     Foo!(Bar!(int).Baz);
     Baz!(Bar!(int));
}
May 25 2013
prev sibling next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
Uneditable newsgroups. Simplest case.

struct Bar(T) {}

struct Foo(T : A(B), A, B) {
     static void f() {}
}

void main() {
     Foo!(Bar!(int)).f();
}
May 25 2013
prev sibling next sibling parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Saturday, 25 May 2013 at 12:13:42 UTC, Ahuzhgairl wrote:
 Uneditable newsgroups. Simplest case.

 struct Bar(T) {}

 struct Foo(T : A(B), A, B) {
     static void f() {}
 }

 void main() {
     Foo!(Bar!(int)).f();
 }

Two problems with that: 1. A(B) should be A!(B) 2. A won't bind to Bar because Bar is not a type, it is a template. A should be an alias. This works: struct Bar(T) {} struct Foo(T : A!(B), alias A, B) { static void f() {} } void main() { Foo!(Bar!(int)).f(); }
May 25 2013
prev sibling next sibling parent Kenji Hara <k.hara.pg gmail.com> writes:
--047d7bd768bc960d0004dd8a1d57
Content-Type: text/plain; charset=UTF-8

2013/5/25 Ahuzhgairl <bulletproofchest gmail.com>

 Uneditable newsgroups. Simplest case.

 struct Bar(T) {}

 struct Foo(T : A(B), A, B) {
     static void f() {}
 }

 void main() {
     Foo!(Bar!(int)).f();
 }

It would work. struct Bar(T) {} struct Foo(T : A!(B), alias A, B) { // 1, 2 static void f() {} } void main() { Foo!(Bar!(int)).f(); } 1. should use A!(B), instead of A(B) 2. A would match to template, so should receive by TemplateAliasParameter. Kenji Hara --047d7bd768bc960d0004dd8a1d57 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>2013/5/25 Ahuzhgairl <span dir=3D"ltr">&lt;<a href=3D= "mailto:bulletproofchest gmail.com" target=3D"_blank">bulletproofchest gmai= l.com</a>&gt;</span><br></div><div class=3D"gmail_extra"><div class=3D"gmai= l_quote"> <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p= adding-left:1ex">Uneditable newsgroups. Simplest case.<br> <br> struct Bar(T) {}<br> <br> struct Foo(T : A(B), A, B) {<br> =C2=A0 =C2=A0 static void f() {}<br> }<br> <br> void main() {<br> =C2=A0 =C2=A0 Foo!(Bar!(int)).f();<br> }<br> </blockquote></div><br></div><div class=3D"gmail_extra">It would work.<div>= <br></div><div><div>struct Bar(T) {}</div><div>struct Foo(T : A!(B), alias = A, B) { =C2=A0 // 1, 2</div><div>=C2=A0 =C2=A0 static void f() {}</div><div=
}</div><div>

</div><div><br></div><div style>1. should use A!(B), instead of A(B)</div>=

Parameter.</div> <div><br></div><div style>Kenji Hara</div></div></div> --047d7bd768bc960d0004dd8a1d57--
May 25 2013
prev sibling next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
C++ example, works:

template <class> struct A;
template <template <class> class X, class Y> struct A<X<Y>> {};

template <class> struct B;

int main() {
     A<B<int>> a;
}



But the following does not work:

struct Foo {};
template <class> struct B { Foo x; }

template <nontype P> struct A;
template <auto M, auto C, nontype P> struct A<M C::*P> {}

int main() {
     A<&B<int>::x> a;
}


D should be able to do both.
May 25 2013
prev sibling next sibling parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Saturday, 25 May 2013 at 12:43:42 UTC, Ahuzhgairl wrote:
 C++ example, works:

 template <class> struct A;
 template <template <class> class X, class Y> struct A<X<Y>> {};

 template <class> struct B;

 int main() {
     A<B<int>> a;
 }

As we've shown, you can do this in D. Instead of template templates, you use alias.
 But the following does not work:

 struct Foo {};
 template <class> struct B { Foo x; }

 template <nontype P> struct A;
 template <auto M, auto C, nontype P> struct A<M C::*P> {}

 int main() {
     A<&B<int>::x> a;
 }

It's getting very hard to see what you're trying to do. I think it would help if you used real C++ and D syntax instead of inventing new syntax because I can't tell what you're trying to achieve and what semantics you expect of it. Please post a small example of real, working, compilable C++ that shows what you want to do, and we'll show you how to do it in D (assuming it is possible).
May 25 2013
prev sibling next sibling parent Kenji Hara <k.hara.pg gmail.com> writes:
--e89a8f234d498033b704dd8b282f
Content-Type: text/plain; charset=UTF-8

2013/5/25 Ahuzhgairl <bulletproofchest gmail.com>

 No,

 struct Foo(T) {
     static void f() { writeln("general"); }
 }

 struct Foo(T : A(B).alias C, A, B, C) {
     static void f() { writeln("special"); }
 }

 struct Bar(T) {
     struct Baz {}
 }

 struct Baz(T : A(B), A, B) {
 }

 void main() {
     Foo!(Bar!(int).Baz);
     Baz!(Bar!(int));
 }

As I already shown, Baz!(Bar!(int)); could work in D. But, currently Foo!(Bar!(int).Baz); is not yet supported. I'm opening a compiler enhancement for related case, http://d.puremagic.com/issues/show_bug.cgi?id=9022 and right now I updated compiler patch to allow parameterize enclosed type by name/type/alias. https://github.com/D-Programming-Language/dmd/pull/1296 https://github.com/9rnsr/dmd/commit/b29726d30b0094b9e7c2e15f5802501cb686ee68 After it is merged, you can write it as follows. import std.stdio; struct Foo(T) { static void f() { writeln("general"); } } struct Foo(T : A!(B).C, alias A, B, alias C) { static void f() { writeln("special"); } } struct Bar(T) { struct Baz {} } void main() { Foo!(Bar!(int).Baz) x; x.f(); // prints "special" } Kenji Hara --e89a8f234d498033b704dd8b282f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">2013/5/25 Ahuzhgairl <span dir=3D"ltr">&lt;<a href=3D"mail= to:bulletproofchest gmail.com" target=3D"_blank">bulletproofchest gmail.com= </a>&gt;</span><br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><b= lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le= ft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pad= ding-left:1ex"> No,<br><br> struct Foo(T) {<br> =C2=A0 =C2=A0 static void f() { writeln(&quot;general&quot;); }<br> }<br> <br> struct Foo(T : A(B).alias C, A, B, C) {<br> =C2=A0 =C2=A0 static void f() { writeln(&quot;special&quot;); }<br> }<br> <br> struct Bar(T) {<br> =C2=A0 =C2=A0 struct Baz {}<br> }<br> <br> struct Baz(T : A(B), A, B) {<br> }<br> <br> void main() {<br> =C2=A0 =C2=A0 Foo!(Bar!(int).Baz);<br> =C2=A0 =C2=A0 Baz!(Bar!(int));<br> }<br> </blockquote></div><br></div><div class=3D"gmail_extra" style>As I already = shown, Baz!(Bar!(int)); could work in D.</div><div class=3D"gmail_extra" st= yle><br></div><div class=3D"gmail_extra" style>But, currently Foo!(Bar!(int= ).Baz); is not yet supported.</div> <div class=3D"gmail_extra" style><br></div><div class=3D"gmail_extra" style=
I&#39;m opening a compiler enhancement for related case,</div><div class=

i?id=3D9022">http://d.puremagic.com/issues/show_bug.cgi?id=3D9022</a><br> </div><div class=3D"gmail_extra" style><br></div><div class=3D"gmail_extra"= style>and right now I updated compiler patch to allow parameterize enclose= d type by name/type/alias.</div><div class=3D"gmail_extra" style><a href=3D= "https://github.com/D-Programming-Language/dmd/pull/1296">https://github.co= m/D-Programming-Language/dmd/pull/1296</a><br> </div><div class=3D"gmail_extra" style><a href=3D"https://github.com/9rnsr/= dmd/commit/b29726d30b0094b9e7c2e15f5802501cb686ee68">https://github.com/9rn= sr/dmd/commit/b29726d30b0094b9e7c2e15f5802501cb686ee68</a><br></div><div cl= ass=3D"gmail_extra" style> <br></div><div class=3D"gmail_extra" style>After it is merged, you can writ= e it as follows.</div><div class=3D"gmail_extra" style><br></div><div class= =3D"gmail_extra" style><div class=3D"gmail_extra">import std.stdio;</div><d= iv class=3D"gmail_extra"> struct Foo(T)</div><div class=3D"gmail_extra">{</div><div class=3D"gmail_ex= tra">=C2=A0 =C2=A0 static void f() { writeln(&quot;general&quot;); }</div><= div class=3D"gmail_extra">}</div><div class=3D"gmail_extra">struct Foo(T : = A!(B).C, alias A, B, alias C)<br> </div><div class=3D"gmail_extra">{</div><div class=3D"gmail_extra">=C2=A0 = =C2=A0 static void f() { writeln(&quot;special&quot;); }</div><div class=3D= "gmail_extra">}</div><div class=3D"gmail_extra"><br></div><div class=3D"gma= il_extra">struct Bar(T) { struct Baz {} }</div> <div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">void main()= </div><div class=3D"gmail_extra">{</div><div class=3D"gmail_extra">=C2=A0 = =C2=A0 Foo!(Bar!(int).Baz) x;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0= x.f(); =C2=A0// prints &quot;special&quot;</div> <div class=3D"gmail_extra">}</div><div><br></div><div style>Kenji Hara</div=
</div></div>

--e89a8f234d498033b704dd8b282f--
May 25 2013
prev sibling next sibling parent reply "deadalnix" <deadalnix gmail.com> writes:
On Saturday, 25 May 2013 at 10:46:05 UTC, Ahuzhgairl wrote:
 Hi,

 In D, the : in a template parameter list only binds to 1 
 parameter.
 There is no way to specialize upon the entire template 
 parameter list.
 Therefore you can't do much with the pattern matching and it's 
 not powerful.
 Not a reasonable situation for a language aiming to be only the 
 best.

 What is needed is the ability to bind to the whole template 
 parameter list:

 template <class> struct get_class;
 template <class R, class C, class... A> struct get_class<R 
 (C::*)(A...)> { typedef C type; };

 Let's shorten the terms:

 <R, C, A...>   <R (C::*)(A...)>

 And here's how this kind of specialization would work in D:

 template A[B] { struct C {} } template Foo[alias X, Y, Z   
 X[Y].Z] { alias Z Foo; } void main() { alias Foo[A[bool].C] 
 xxx; }

 You need a separate delimiter besides : which does not bind to 
 individual parameters, but which binds to the set of parameters.

 I propose   as the character which shall be the delimiter for 
 the arguments to the pattern match, and the pattern match.

 On an unrelated note, I don't like the ! thing so I use []. 
 Sorry for the confusion there.

 z

Hi, I obviously don't know D that much, but I assume I do. I have this feature that I can't even show a working example that exists in C++. I also can't come up with any use case, but I know this is mandatory to have. As I assume I know D well enough, I assume I know that this is impossible in D, so I propose an improvement. With that improvement, a new syntax is introduced to support some new feature that is barely defined and it can be used in unknown situation. I also explain myself using my own made up syntax. I don't care if it conflict with other language construct as it is superior anyway.
May 25 2013
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/25/13 12:27 PM, deadalnix wrote:
 Hi, I obviously don't know D that much, but I assume I do.

 I have this feature that I can't even show a working example that exists
 in C++. I also can't come up with any use case, but I know this is
 mandatory to have.

 As I assume I know D well enough, I assume I know that this is
 impossible in D, so I propose an improvement.

 With that improvement, a new syntax is introduced to support some new
 feature that is barely defined and it can be used in unknown situation.

 I also explain myself using my own made up syntax. I don't care if it
 conflict with other language construct as it is superior anyway.

A great thing about this community is it being nice and helpful to newcomers. (That said, I had a good chuckle - I've seen this pattern before.) To the OP: you may want to look into template constraints, they're much easier to define and use than pattern matching in template arguments. Also, aliases are quite a bit more convenient and general than C++'s template template arguments, which run completely amok at the third regression: template<template<template <class> class> class T> class C; Andrei
May 25 2013
prev sibling next sibling parent "Joshua Niehus" <jm.niehus gmail.com> writes:
On Saturday, 25 May 2013 at 16:27:59 UTC, deadalnix wrote:
 Hi, I obviously don't know D that much, but I assume I do.
 [..snip..]

<chuckle> +1
May 25 2013
prev sibling next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
Kenji,
Thank you much for the '.C' alias support, Amazed to see there 
could be some action so quick!


Could we please look at the nontype-as-primary-template?

How can we deduce all of the dependent types from a non-type 
template parameter, if it's the only parameter of the primary 
template?



struct Foo {};
template <class> struct B { Foo x; }

template <nontype P> struct A;
// P is the primary-template param

template <auto M, auto C, nontype P> struct A<M C::*P> {
     // Given the call in main,
     // M is deduced as Foo
     // C is deduced as B<int>
     // P was passed successfully and we know the types that make 
it up.
}

int main() {
     auto mp = &B<B<int>>::x
     A<mp> a;
}
May 25 2013
prev sibling next sibling parent Kenji Hara <k.hara.pg gmail.com> writes:
--e89a8f234d4902f90704dd970042
Content-Type: text/plain; charset=UTF-8

2013/5/26 Ahuzhgairl <bulletproofchest gmail.com>

 Kenji,
 Thank you much for the '.C' alias support, Amazed to see there could be
 some action so quick!


 Could we please look at the nontype-as-primary-template?

 How can we deduce all of the dependent types from a non-type template
 parameter, if it's the only parameter of the primary template?




 struct Foo {};
 template <class> struct B { Foo x; }

 template <nontype P> struct A;
 // P is the primary-template param


 template <auto M, auto C, nontype P> struct A<M C::*P> {
     // Given the call in main,
     // M is deduced as Foo
     // C is deduced as B<int>
     // P was passed successfully and we know the types that make it up.
 }

 int main() {
     auto mp = &B<B<int>>::x
     A<mp> a;
 }

Hmm. Currently D can specify specType for alias template parameter. struct X(alias int x) {} // matches only when the symbol x has the type int void main() { int a; X!a xa; // match OK long b; X!b xb; // match NG } But, compiler does not allow parameterize of specType. struct Foo {} struct B(T) { static Foo x; } //struct A(alias P) {} struct A(alias M* P, M) // matches only when the symbol P has the type M* //struct A(alias C.M* P, M, C) { } void main() { auto mp = &B!(B!int).x; A!mp a; // does not match... } I think it should be allowed. Kenji Hara --e89a8f234d4902f90704dd970042 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">2013/5/26 Ahuzhgairl <span dir=3D"ltr">&lt;<a href=3D"mail= to:bulletproofchest gmail.com" target=3D"_blank">bulletproofchest gmail.com= </a>&gt;</span><br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><b= lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le= ft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pad= ding-left:1ex"> Kenji,<br> Thank you much for the &#39;.C&#39; alias support, Amazed to see there coul= d be some action so quick!<br> <br> <br> Could we please look at the nontype-as-primary-template?<br> <br> How can we deduce all of the dependent types from a non-type template param= eter, if it&#39;s the only parameter of the primary template?<div class=3D"= im"><br> <br> <br> <br> struct Foo {};<br> template &lt;class&gt; struct B { Foo x; }<br> <br> template &lt;nontype P&gt; struct A;<br></div> // P is the primary-template param<div class=3D"im"><br> <br> template &lt;auto M, auto C, nontype P&gt; struct A&lt;M C::*P&gt; {<br></d= iv> =C2=A0 =C2=A0 // Given the call in main,<br> =C2=A0 =C2=A0 // M is deduced as Foo<br> =C2=A0 =C2=A0 // C is deduced as B&lt;int&gt;<br> =C2=A0 =C2=A0 // P was passed successfully and we know the types that make = it up.<br> }<br> <br> int main() {<br> =C2=A0 =C2=A0 auto mp =3D &amp;B&lt;B&lt;int&gt;&gt;::x<br> =C2=A0 =C2=A0 A&lt;mp&gt; a;<br> }<br> </blockquote></div><br></div><div class=3D"gmail_extra" style>Hmm. Currentl= y D can specify specType for alias template parameter.</div><div class=3D"g= mail_extra" style><br></div><div class=3D"gmail_extra" style><div class=3D"= gmail_extra"> struct X(alias int x) {} =C2=A0 // matches only when the symbol x has the t= ype int</div><div class=3D"gmail_extra">void main()</div><div class=3D"gmai= l_extra">{</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 int a;</div><div c= lass=3D"gmail_extra"> =C2=A0 =C2=A0 X!a xa; // match OK</div><div class=3D"gmail_extra">=C2=A0 = =C2=A0 long b;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 X!b xb; // mat= ch NG</div><div class=3D"gmail_extra">}</div><div><br></div><div style>But,= compiler does not allow parameterize of specType.</div> <div style><br></div><div style><div>struct Foo {}</div><div>struct B(T) { = static Foo x; }<br></div><div><br></div><div><div>//struct A(alias P) {}</d= iv></div><div><div><br></div><div>struct A(alias M* P, M) =C2=A0 =C2=A0// m= atches only when the symbol P has the type M*</div> </div><div><div>//struct A(alias C.M* P, M, C)</div></div><div>{</div><div>= }</div><div><br></div><div><div>void main()</div><div>{</div><div>=C2=A0 = =C2=A0 auto mp =3D &amp;B!(B!int).x;<br></div><div>=C2=A0 =C2=A0 A!mp a; = =C2=A0 // does not match...<br> </div><div>}</div></div><div><br></div><div style>I think it should be allo= wed.</div><div style><br></div><div style>Kenji Hara</div></div></div></div=

--e89a8f234d4902f90704dd970042--
May 25 2013
prev sibling next sibling parent "Ahuzhgairl" <bulletproofchest gmail.com> writes:
Kenji, thanks again for understanding exactly what I meant.

I am a big fan of template features. I seriously hope D can do 
this in the future- the inability of the *template system* to 
deduce information about non-types is one of the big holes in C++:

We can deduce information at function scope, yet the templates 
cannot do it!
This is a strange imbalance of nature.
May 25 2013
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 5/26/13, Kenji Hara <k.hara.pg gmail.com> wrote:
 Hmm. Currently D can specify specType for alias template parameter.

 struct X(alias int x) {}   // matches only when the symbol x has the type int

This feature is news to me! Pretty cool. Philippe Sigaud: Is this mentioned in the D Template book?
May 26 2013
prev sibling next sibling parent Manu <turkeyman gmail.com> writes:
--047d7b2e489a3838c304dda742d1
Content-Type: text/plain; charset=UTF-8

On 26 May 2013 16:41, Ahuzhgairl <bulletproofchest gmail.com> wrote:

 Kenji, thanks again for understanding exactly what I meant.

 I am a big fan of template features. I seriously hope D can do this in the
 future- the inability of the *template system* to deduce information about
 non-types is one of the big holes in C++:

 We can deduce information at function scope, yet the templates cannot do
 it!
 This is a strange imbalance of nature.

I presume this is Ndit from IRC? The part that breaks my mind, is that you appeared professing you were missing requirements for realtime critical software (and significantly more realtime critical than my own work apparently), but then you became the most obscure template crazed dude I've ever seen. In my experience, the 2 are fundamentally incompatible. A realtime programmer with requirements as strict as you claim, would avoid intensive (ab)use of templates like the plague! :/ It really seems like you're just trying to break D in whichever way you can (and having some trouble). And now in 3 cases, where you have successfully 'broken' D, a helpful member from the community has taken it upon themselves to help you and give you what you want. Have you actually tried working with D templates for a while. Templates are, hands down, the strongest and most compelling feature of D. If you actually use D for a short time, you will realise this. Now, I tend to think the level of support shown to you is spectacular, taking entire days of peoples time. Especially considering you've never managed to produce an actual use cased for anything you've come up with. But I'd like to make a suggestion that you actually USE D for a while, and waste peoples time with REAL USE CASES where you find that your needs are not satisfied. D is a volunteer community, if you never plan to use these improvements, and nobody else ever does, then you're effectively wasting their time, which is a little unfair. --047d7b2e489a3838c304dda742d1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">On 26 May 2013 16:41, Ahuzhgairl <span dir=3D"ltr">&lt;<a = href=3D"mailto:bulletproofchest gmail.com" target=3D"_blank">bulletproofche= st gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class= =3D"gmail_quote"> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Kenji, thanks again for understanding exactl= y what I meant.<br> <br> I am a big fan of template features. I seriously hope D can do this in the = future- the inability of the *template system* to deduce information about = non-types is one of the big holes in C++:<br> <br> We can deduce information at function scope, yet the templates cannot do it= !<br> This is a strange imbalance of nature.<br> </blockquote></div><br></div><div class=3D"gmail_extra" style>I presume thi= s is Ndit from IRC?</div><div class=3D"gmail_extra" style>The part that bre= aks my mind, is that you appeared professing you were missing requirements = for realtime critical software (and significantly more realtime critical th= an my own work apparently), but then you became the most obscure template c= razed dude I&#39;ve ever seen.</div> <div class=3D"gmail_extra" style>In my experience, the 2 are fundamentally = incompatible. A realtime programmer with requirements as strict as you clai= m, would avoid intensive (ab)use of templates like the plague! :/</div><div= class=3D"gmail_extra" style> It really seems like you&#39;re just trying to break D in whichever way you= can (and having some trouble).</div><div class=3D"gmail_extra" style>And n= ow in 3 cases, where you have successfully &#39;broken&#39; D, a helpful me= mber from the community has taken it upon themselves to help you and give y= ou what you want.</div> <div class=3D"gmail_extra" style>Have you actually tried working with D tem= plates for a while. Templates are, hands down, the strongest and most compe= lling feature of D. If you actually use D for a short time, you will realis= e this.<br> </div><div class=3D"gmail_extra" style><br></div><div class=3D"gmail_extra"= style>Now, I tend to think the level of support shown to you is spectacula= r, taking entire days of peoples time. Especially considering you&#39;ve ne= ver managed to produce an actual use cased for anything you&#39;ve come up = with.</div> <div class=3D"gmail_extra" style>But I&#39;d like to make a suggestion that= you actually USE D for a while, and waste peoples time with REAL USE CASES= where you find that your needs are not satisfied.</div><div class=3D"gmail= _extra" style> D is a volunteer community, if you never plan to use these improvements, an= d nobody else ever does, then you&#39;re effectively wasting their time, wh= ich is a little unfair.</div></div> --047d7b2e489a3838c304dda742d1--
May 26 2013
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 5/27/13, Timon Gehr <timon.gehr gmx.ch> wrote:
 The reason is that the feature is undocumented. (The grammar
 specification mentions the syntax, though.)

I wonder how many other easter eggs there are in the language. :p
May 27 2013