Simplify Type Traits example (#35)

The `std::is_<type>::value` already returns a `bool`, so comparing it to `1` is unnecessary.
This commit is contained in:
Tulio Leao
2018-08-04 22:31:23 -03:00
committed by Anthony Calandra
parent 21c9492403
commit 79c439134f
2 changed files with 6 additions and 6 deletions

View File

@@ -604,9 +604,9 @@ std::to_string(123); // == "123"
### Type traits
Type traits defines a compile-time template-based interface to query or modify the properties of types.
```c++
static_assert(std::is_integral<int>::value == 1);
static_assert(std::is_same<int, int>::value == 1);
static_assert(std::is_same<std::conditional<true, int, double>::type, int>::value == 1);
static_assert(std::is_integral<int>::value);
static_assert(std::is_same<int, int>::value);
static_assert(std::is_same<std::conditional<true, int, double>::type, int>::value);
```
### Smart pointers

View File

@@ -1153,9 +1153,9 @@ std::to_string(123); // == "123"
### Type traits
Type traits defines a compile-time template-based interface to query or modify the properties of types.
```c++
static_assert(std::is_integral<int>::value == 1);
static_assert(std::is_same<int, int>::value == 1);
static_assert(std::is_same<std::conditional<true, int, double>::type, int>::value == 1);
static_assert(std::is_integral<int>::value);
static_assert(std::is_same<int, int>::value);
static_assert(std::is_same<std::conditional<true, int, double>::type, int>::value);
```
### Smart pointers