Improve some docs in std.traits#5287
Conversation
std/traits.d
Outdated
| static assert(isIntegral!int); | ||
| static assert(isIntegral!long); | ||
|
|
||
| static assert(!isIntegral!double); |
There was a problem hiding this comment.
Add tests for bool and char please.
There was a problem hiding this comment.
For compactness you may group all true asserts together and all false asserts together:
static assert(isIntegral!byte && isIntegral!short && ...);
static assert(!isIntegral!double && ...);In fact if you exhaustively enumerate all cases for true there's no need for example for false.
std/traits.d
Outdated
| struct S | ||
| { | ||
| int val; | ||
|
|
There was a problem hiding this comment.
why would there ever be an empty line in a 4-line struct... cc @wilzbach
std/traits.d
Outdated
| { | ||
| static assert(isFloatingPoint!float); | ||
| static assert(isFloatingPoint!double); | ||
| static assert(isFloatingPoint!real); |
There was a problem hiding this comment.
add a qualifier somewhere to clarify it works with qualifiers as well
|
@andralex These tests are purely for documentation. The more comprehensive tests for these traits already exist below these. |
67b3768 to
0b25088
Compare
|
I understand, but really "how about char and bool?" and "does it work with qualifiers?" are the first that come to any user's mind! |
c15d598 to
b77cabe
Compare
|
@andralex Integrated your suggestions while still trying to keep it as clear as possible. |
b77cabe to
118f2d7
Compare
No description provided.