DMD optimization bug?

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Mar 22 05:00:57 PDT 2013


22-Mar-2013 15:56, Jacob Carlborg пишет:
> On 2013-03-22 10:07, Dmitry Olshansky wrote:
>
>> What's wrong with returning slice by value ?
>
> I want to know both if it exists and get back the value. I could use an
> out parameter for that though.
>

Yes, that or ref parameter.

Another option is:

return null - doesn't exists (both ptr and .length are zeros)

return a slice that has zero length and non-zero ptr - exists but empty

Dunno if it's suitable to what your doing with it later on.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list