inout and function/delegate parameters
Stewart Gordon
smjg_1998 at yahoo.com
Wed Mar 7 15:01:10 PST 2012
On 07/03/2012 22:48, Steven Schveighoffer wrote:
> On Wed, 07 Mar 2012 17:37:53 -0500, Stewart Gordon <smjg_1998 at yahoo.com> wrote:
<snip>
>> cast() is an abomination. I'm not sure OTTOMH whether it's a bug that it works.
>
> Sorry, it's just easier than typing cast(int*).
Which is another abomination. The means of casting away constancy should be explicit.
<snip>
>>> But from an API point of view, I look at at inout as guaranteeing anything the parameter
>>> points at won't change while inside the function *using that parameter*. Even though it's
>>> legal, it's disingenuous (at least as long as we define inout that way).
>>
>> That's what const is for.
>
> And inout. Sorry, it was meant that way, even if you don't agree.
Maybe _you_ meant it that way, but did anyone else?
Stewart.
More information about the Digitalmars-d
mailing list