Dispatching values to handlers, as in std.concurrency

"Luís "Luís
Fri May 24 12:09:24 PDT 2013


On Tuesday, 7 May 2013 at 06:19:24 UTC, Idan Arye wrote:
> If it's not templated - make it templated! You don't have to 
> make the entire `TypeHanler` templated, just the method that 
> creates it. There, you can create an anonymous function that 
> receives `Object` and returns `bool` and all it does is check 
> for type, and you can have a field in `TypeHandler` that keeps 
> that function and uses it to check if it can handle a certain 
> type.

Thanks. It took me a while to understand what you meant, but it's 
working.


More information about the Digitalmars-d-learn mailing list