digitalmars.D.bugs - [Issue 2494] New: describe explicit casting of arrays
- d-bugmail puremagic.com (21/21) Dec 06 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2494
- d-bugmail puremagic.com (7/7) Dec 06 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2494
- d-bugmail puremagic.com (11/11) Mar 12 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2494
- d-bugmail puremagic.com (9/9) Jan 22 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2494
- d-bugmail puremagic.com (9/9) Jan 22 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2494
- d-bugmail puremagic.com (10/10) Jan 22 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2494
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Summary: describe explicit casting of arrays Product: D Version: 2.021 Platform: PC URL: http://www.digitalmars.com/d/2.0/arrays.html OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: www.digitalmars.com AssignedTo: bugzilla digitalmars.com ReportedBy: jlquinn optonline.net It's possible and necessary at times to cast arrays for systems work. For example: ubyte[] ba = readdata(); uint[] = cast(uint[])ba; This isn't described and needs to be if it's supported in the language. I'm assuming it's supported, because otherwise many things would be difficult. Also, any limitations ala C++ aliasing rules need to be described. --
Dec 06 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Huh, I would've expected it to be documented somewhere. But yes, it's legal, and will throw a runtime error if there is a size mismatch (that is, if the size of the array in bytes is not an even multiple of the destination type element size). --
Dec 06 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Trass3r <mrmocool gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mrmocool gmx.de The only bit of information is at: http://www.digitalmars.com/d/2.0/expression.html#ArrayLiteral -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 12 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Commit pushed to https://github.com/D-Programming-Language/d-programming-language.org https://github.com/D-Programming-Language/d-programming-language.org/commit/8681d6fb36bd7a00a395bfc66205d5dbe8b19d88 Issue 2494 - describe explicit casting of arrays -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 22 2012
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Commit pushed to https://github.com/D-Programming-Language/d-programming-language.org https://github.com/D-Programming-Language/d-programming-language.org/commit/8ae9018edcc3499480fa73d928d2be98b90a4fe7 free Issue 2494 - describe explicit casting of arrays -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 22 2012
http://d.puremagic.com/issues/show_bug.cgi?id=2494 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 22 2012