[Issue 3934] Some untidy attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 23 09:28:43 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=3934



--- Comment #17 from bearophile_hugs at eml.cc 2011-01-23 09:26:37 PST ---
(In reply to comment #16)
> This shows something strange, dmd 2.051:

According to Mafi that code is correct:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=24058

> I think it's absolutely correct. Look: Foo3 is declared as const
> struct meaning all it's members are const. We are passing a struct
> like that to bar3:
>  const Foo3 { const int* p}
> which is implicitely converted to:
>  Foo3 { const int* p } //not ref !!
> Because it's not ref you can't manipulate the original struct anyways
> and the pointer is still const. As long as you don't cast you cannot
> change what the pointer points to so this implicit conversion is
> correct IMO.
> It's like const(T[]) => const(T)[] .

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list