What IDE/EDITOR do you use for D?
via Digitalmars-d
digitalmars-d at puremagic.com
Thu Oct 30 02:39:41 PDT 2014
On Thursday, 30 October 2014 at 08:02:49 UTC, Paulo Pinto wrote:
>> 3. No non-const ref parameters to functions, use pointers.
>> They want a visible "&" at call site for output parameters.
>> e.g. "read(&var)" so that you don't have to look the function
>> up in the docs.
>>
>
> Coming from a Quick/Turbo Basic/Turbo Pascal background, I
> never understood the C culture about function parameters.
>
> Just another example of C being unsafe.
C is unsafe, but it is desirable to make it visible at the call
site that you are returning a value through a parameter. I think
it is a good idea to create a special "zero-cost" wrapper type so
that you write:
copy_from_to( input, returns(output) )
I noticed that c++11 has a ref() function:
http://en.cppreference.com/w/cpp/utility/functional/ref
More information about the Digitalmars-d
mailing list