any news on const/invariant?
Derek Parnell
derek at nomail.afraid.org
Wed Nov 28 22:09:32 PST 2007
On Wed, 28 Nov 2007 21:27:35 -0800, Walter Bright wrote:
> To make a type const, you add parens:
>
> const(T)
>
> So, to make a const function that returns a constant T:
>
> const(const(T) f())
Is this supposed to compile? I can't get it to work.
For the source line ...
const(const(int*) f()){}
I get the message ...
test.d(3): unexpected identifer 'f' in declarator
test.d(3): no identifier for declarator const(int*)()
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
29/11/2007 5:07:48 PM
More information about the Digitalmars-d
mailing list