Re: Difference between template and mixin template

2019-10-10 Thread Just Dave via Digitalmars-d-learn
: a) Is this correct usage? b) It compiles if I just do: template NumberTemplate() { private: int number = 0; public: int getNumber(int number) { return number; } } what is the difference between template and mixin template? Sorry I

Difference between template and mixin template

2019-10-10 Thread Just Dave via Digitalmars-d-learn
: template NumberTemplate() { private: int number = 0; public: int getNumber(int number) { return number; } } what is the difference between template and mixin template?

what is the difference between template and mixin template

2012-06-10 Thread Zhenya
Hi!Today I completly understood,what I don't now what is the difference between template and mixin template,becouse I think that this should'nt work.But compiler is disagree.Could anybody explain me please? import std.stdio; int x; template smth() { void smth(){x = 1;} } void main

Re: what is the difference between template and mixin template

2012-06-10 Thread Artur Skawina
On 06/10/12 19:08, Zhenya wrote: Hi!Today I completly understood,what I don't now what is the difference between template and mixin template,becouse I think that this should'nt work.But compiler is disagree.Could anybody explain me please? import std.stdio; int x; template smth

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
I read in documentation,that we have two ways to use mixin statement. 1st: mixin(string_wich_can_be_evaluated_at_compile_time); 2st:mixin template I could'nt find any information about such way to use it

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
On Sunday, 10 June 2012 at 17:34:19 UTC, Zhenya wrote: I read in documentation,that we have two ways to use mixin statement. 1st: mixin(string_wich_can_be_evaluated_at_compile_time); 2st:mixin template I could'nt find any information about such way to use it Also,in this case if we add mixin

Re: what is the difference between template and mixin template

2012-06-10 Thread Ali Çehreli
On 06/10/2012 10:08 AM, Zhenya wrote: Hi!Today I completly understood,what I don't now what is the difference between template and mixin template There is a terminology problem: there is no such thing as mixin templates. There are only templates. D also has the mixin feature with two

Re: what is the difference between template and mixin template

2012-06-10 Thread Jonathan M Davis
On Sunday, June 10, 2012 12:05:48 Ali Çehreli wrote: On 06/10/2012 10:08 AM, Zhenya wrote: Hi!Today I completly understood,what I don't now what is the difference between template and mixin template There is a terminology problem: there is no such thing as mixin templates

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
I see. Thank you,guys)