www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5013] New: std.typecons.Tuple should have constructor for static arrays

reply d-bugmail puremagic.com writes:
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: -------
Oct 07 2010
next sibling parent d-bugmail puremagic.com writes:
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: -------
Oct 07 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Apr 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Apr 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5013


Alex Rnne 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: -------
Feb 24 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5013


Alex Rnne 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: -------
Feb 24 2013