enforce()?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 16 11:59:45 PDT 2010


Michel Fortin wrote:
> On 2010-06-16 14:44:29 -0400, Michel Fortin <michel.fortin at michelf.com> 
> said:
> 
>> On 2010-06-16 14:10:17 -0400, Jonathan M Davis <jmdavisProg at gmail.com> 
>> said:
>>
>>> I would point out that pretty much nothing in std.contracts actually 
>>> relates
>>> to contracts. Rather, it relates to error handling. So, it would 
>>> probably be
>>> a good idea to simply rename the module - perhaps to std.error.
>>
>> I concur: the module is misnamed. The only things not related to error 
>> handling are assumeUnique and assumeSorted, and I fail to see the link 
>> with design by contract for either one.
> 
> Oh, forgot about "pointsTo" too. What's the link with contracts, or 
> error handling?

Certain functions (notably swap) must make sure that there's no mutual 
aliasing between two objects.

Andrei


More information about the Digitalmars-d mailing list