Re: accessing numeric template parameters

2014-11-05 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Monday, 3 November 2014 at 21:17:09 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: struct polynomial(uint base) { private: uint[] N; public: this(uint x) { base = x; } base is part of the type. polynomial is just a 'recipe' for a type, the real struct would be Polynomial!(0),

accessing numeric template parameters

2014-11-03 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
If I have a struct with numeric template parameter, how can I access it within member functions? Like normal member variables? And how about the constructor? struct polynomial(uint base) { private: uint[] N; public: this(uint x) { base = x; } ... void add(Polynomial!base P) {

Re: accessing numeric template parameters

2014-11-03 Thread MrSmith via Digitalmars-d-learn
On Monday, 3 November 2014 at 14:27:47 UTC, Dominikus Dittes Scherkl wrote: If I have a struct with numeric template parameter, how can I access it within member functions? Like normal member variables? And how about the constructor? struct polynomial(uint base) { private: uint[] N;

Re: accessing numeric template parameters

2014-11-03 Thread Philippe Sigaud via Digitalmars-d-learn
On Mon, Nov 3, 2014 at 3:27 PM, Dominikus Dittes Scherkl via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: If I have a struct with numeric template parameter, how can I access it within member functions? Like normal member variables? And how about the constructor? struct