Thread overview
[Issue 12356] New: std.traits.isTypeTuple returns false for any TypeTuple that contains a value
Mar 13, 2014
Andrej Mitrovic
[Issue 12356] std.traits.isTypeTuple is poorly documented
Mar 13, 2014
Andrej Mitrovic
[Issue 12356] std.traits.isTypeTuple and isExpressionTuple are poorly documented
Mar 13, 2014
Andrej Mitrovic
Mar 13, 2014
Andrej Mitrovic
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356

           Summary: std.traits.isTypeTuple returns false for any TypeTuple
                    that contains a value
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: monkeyworks12@hotmail.com


--- Comment #0 from monkeyworks12@hotmail.com 2014-03-12 21:33:15 PDT ---
import std.stdio;
import std.traits;
import std.typetuple;

void main()
{
    //false
    writeln(isTypeTuple!(TypeTuple!("one", "two", "three")));

    //false
    writeln(isTypeTuple!(TypeTuple!("one")));

    //false
    writeln(isTypeTuple!(TypeTuple!(1, 2, 3)));

    //true
    writeln(isTypeTuple!(TypeTuple!()));

    //true
    writeln(isTypeTuple!(TypeTuple!(int)));
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com
          Component|DMD                         |Phobos


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2014-03-13 05:48:39 PDT ---
This is a naming and documentation issue. std.typecons.TypeTuple is really a way to construct a tuple of types, values, symbols, expressions, etc. That's the naming issue, we are aware of this.

isTypeTuple returns true if such a tuple contains types only. There's a similar trait 'isExpressionTuple'. Both of these are not as documented as they should be, and are missing examples.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|nobody@puremagic.com        |andrej.mitrovich@gmail.com
            Summary|std.traits.isTypeTuple      |std.traits.isTypeTuple is
                   |returns false for any       |poorly documented
                   |TypeTuple that contains a   |
                   |value                       |
           Severity|minor                       |normal


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2014-03-13 05:55:20 PDT ---
https://github.com/D-Programming-Language/phobos/pull/2009

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356



--- Comment #3 from monkeyworks12@hotmail.com 2014-03-13 06:05:17 PDT ---
(In reply to comment #1)
> This is a naming and documentation issue. std.typecons.TypeTuple is really a way to construct a tuple of types, values, symbols, expressions, etc. That's the naming issue, we are aware of this.
> 
> isTypeTuple returns true if such a tuple contains types only. There's a similar trait 'isExpressionTuple'. Both of these are not as documented as they should be, and are missing examples.

Thanks for the quick response.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356



--- Comment #4 from github-bugzilla@puremagic.com 2014-03-13 06:55:30 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/6c38d569c8a3c4adde82430b14c4dc540c724788
Fixes Issue 12356 - Add better documentation and add examples for isTypeTuple
and isExpressionTuple.

https://github.com/D-Programming-Language/phobos/commit/4c8ebf4ea1ea9aabbdbffae6fcaffa107b6a74c8 Merge pull request #2009 from AndrejMitrovic/Fix12356

Issue 12356 - Add better documentation and add examples for isTypeTuple and isExpressionTuple.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12356


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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