Re: Templates, templates, templates...

2016-01-24 Thread Voitech via Digitalmars-d-learn
On Saturday, 23 January 2016 at 13:19:34 UTC, anonymous wrote: On 23.01.2016 12:30, Voitech wrote: Ok so i want to hold different types in LogicRule maybe Algebraic implementation would do? private alias ControllTemplate(T) =Rule!(T,ControllFlag); private alias SymbolRule

Re: Templates, templates, templates...

2016-01-24 Thread anonymous via Digitalmars-d-learn
On 24.01.2016 10:02, Voitech wrote: I added base class for Rule -> BaseRule. But this class is just a shell without implementation. Is there any way to avoid this ? What's the problem with BaseRule not having any implementation? When the different Rule instantiations don't have any common

Templates, templates, templates...

2016-01-23 Thread Voitech via Digitalmars-d-learn
Hi, I have a problem with creating proper inheritance chain with templates. First i will give some background about my problem. I'm trying to create a validator for math calculation expressions. I don't want to use regexps as this is approach gives me headache and probably will not allow

Re: Templates, templates, templates...

2016-01-23 Thread anonymous via Digitalmars-d-learn
On 23.01.2016 12:30, Voitech wrote: Ok so i want to hold different types in LogicRule maybe Algebraic implementation would do? private alias ControllTemplate(T) =Rule!(T,ControllFlag); private alias SymbolRule =ControllTemplate!(SymbolType); private alias StringRule