Ironclad C++

Walter Bright newshound2 at digitalmars.com
Sat Aug 3 19:06:02 PDT 2013


On 8/3/2013 5:49 PM, Timon Gehr wrote:
> On 08/04/2013 01:55 AM, Walter Bright wrote:
>> On 8/3/2013 4:32 PM, bearophile wrote:
>>> The paper explains the various cases: assign from ptr<T> into lptr<T>,
>>> assign
>>> from lptr<T> into ptr<T>, and assign from lptr<T> into lptr<T>.
>>>
>>> So with a mix of run-time tests and a small amount of static analysis
>>> the code
>>> is safe and fast enough. It seems a simple enough idea.
>>
>> The problem with different pointer types is, of course, what do you do
>> with functions that take pointers as arguments?
>>
>
> Why would that be a problem?

Consider the canonical example:

     void* foo(void *p) { return p; }

Do you write an overload for each kind of pointer?


More information about the Digitalmars-d mailing list