Thread overview
[Issue 5013] New: std.typecons.Tuple should have constructor for static arrays
Oct 07, 2010
Tomasz Sowiński
Oct 07, 2010
Tomasz Sowiński
Apr 22, 2012
SomeDude
Apr 22, 2012
Jakob Ovrum
October 07, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5013

           Summary: std.typecons.Tuple should have constructor for static
                    arrays
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: All
            Status: ASSIGNED
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: andrei@metalanguage.com
        ReportedBy: tomeksowi@gmail.com


--- Comment #0 from Tomasz Sowiński <tomeksowi@gmail.com> 2010-10-07 13:53:09 PDT ---
Should work:

int[2] ints;
Tuple!(int, int) t = ints;

This leaves the reverse conversion unimplementable. A way out can be:

Tuple!(int, int) t;
auto ints = to!(int[2])(t);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 07, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5013



--- Comment #1 from Tomasz Sowiński <tomeksowi@gmail.com> 2010-10-07 13:58:25 PDT ---
(In reply to comment #0)

> This leaves the reverse conversion unimplementable. A way out can be:
> 
> Tuple!(int, int) t;
> auto ints = to!(int[2])(t);

Or:

auto ints = cast(int[2]) t;

Seems more appropriate as no conversion takes place.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5013


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com
           Severity|normal                      |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5013


Jakob Ovrum <jakobovrum@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakobovrum@gmail.com


--- Comment #2 from Jakob Ovrum <jakobovrum@gmail.com> 2012-04-22 09:14:47 PDT ---
(In reply to comment #1)
> (In reply to comment #0)
> 
> > This leaves the reverse conversion unimplementable. A way out can be:
> > 
> > Tuple!(int, int) t;
> > auto ints = to!(int[2])(t);
> 
> Or:
> 
> auto ints = cast(int[2]) t;
> 
> Seems more appropriate as no conversion takes place.

Structs can have padding, while static arrays cannot.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 25, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5013


Alex Rønne Petersen <alex@lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |alex@lycus.org
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 25, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5013


Alex Rønne Petersen <alex@lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |alex@lycus.org
         Resolution|                            |FIXED


--- Comment #3 from github-bugzilla@puremagic.com 2013-02-24 16:58:48 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/702daca3123caaba3c734d3d5e265c131734ecc4 issue 5013

https://github.com/D-Programming-Language/phobos/commit/35d08ef3d8e1148f2e34b3831cff8eeb649461b3 Merge pull request #1153 from andralex/5013

Fix Issue 5013 - std.typecons.Tuple should have constructor for static arrays

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