DMD 0.170 release

Walter Bright newshound at digitalmars.com
Tue Oct 17 21:29:42 PDT 2006


Sean Kelly wrote:
> I think I agree, but for the sake of argument, how would D handle 'find' 
>  operations on sequences that don't support opIndex?  At some point, a 
> generalizable bookmark is almost necessary for a faithful implementation 
> of some C++ algorithms.  Also, many of these algorithms also require 
> iteration across two sequences simultaneously, which doesn't map very 
> cleanly into foreach.  Consider a substring-style find operation 
> (std::search), for example, where both the pattern and target types do 
> not support opIndex or opSlice.  I might argue that it's a bit silly or 
> unrealistic to desire such an operation, but the C++ algorithm library 
> does support it.

I think the target types will have to support opIndex or opSlice.



More information about the Digitalmars-d-announce mailing list