Bug 12356 – std.traits.isTypeTuple and isExpressionTuple are poorly documented

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-12T21:33:00Z
Last change time
2014-03-13T07:03:21Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
monkeyworks12

Comments

Comment #0 by monkeyworks12 — 2014-03-12T21:33:15Z
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))); }
Comment #1 by andrej.mitrovich — 2014-03-13T05:48:39Z
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.
Comment #2 by andrej.mitrovich — 2014-03-13T05:55:20Z
Comment #3 by monkeyworks12 — 2014-03-13T06:05:17Z
(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.
Comment #4 by github-bugzilla — 2014-03-13T06:55:30Z
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.