UDAs - Restrict to User Defined Types?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Thu Nov 8 22:44:51 PST 2012


On Thu, 08 Nov 2012 21:10:55 -0800
Walter Bright <newshound2 at digitalmars.com> wrote:
> 
> Many algorithms (at least the ones in Phobos do) already do a check
> to ensure the inputs are the correct kind of range. I don't think
> you'll get very far trying to use a range that isn't a range.
> 

It can't check semantics. If something "looks" like a range function,
but wasn't written with the explicit intent of actually being one, then
it's a crapshoot as to whether the semantics actually conform. But
the ducktyping D does do will go and blindly assume.




More information about the Digitalmars-d mailing list