A Refcounted Array Type

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 23 17:10:53 PST 2015


On 2/23/2015 4:13 PM, bearophile wrote:
>> 5. bounds checking
>
> When you go past bounds of a built-in array you get an error located in the user
> code, while if you put a pre-condition in your Array struct to detect the same
> errors, you get a run-time error message located in that pre-condition instead.
> I'd like some way to solve this small problem of giving more correctly located
> error messages. In Contract programming lingo it's a problem of "blame
> management" (I'd also like a way to detect some compile-time out-of-bound errors
> for user-defined collections, but you said this is not worth the effort).

This is off-topic. The point of the array class as presented is to show how a 
memory safe reference counted container can be built.



More information about the Digitalmars-d mailing list