Skip to content

Commit f919f45

Browse files
committed
Add support for [[nodiscard]]
1 parent c69474c commit f919f45

File tree

2 files changed

+289
-263
lines changed

2 files changed

+289
-263
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
[RValue References](#rvalue-references)<br/>
2121
[constexpr](#constexpr)<br/>
2222
[noexcept](#noexcept)<br/>
23+
[nodiscard](#nodiscard)<br/>
2324
[Changelog](#changelog)<br/>
2425
[History](#history)<br/>
2526
[License](#license)
@@ -912,8 +913,25 @@ work-around:
912913
#undef noexcept
913914
```
914915

916+
## nodiscard
917+
918+
When compiling with C++17 or higher, all generated methods are marked `[[nodiscard]]`.
919+
For compilers that do not support `[[nodiscard]]` or when it is causing trouble,
920+
you can disable it defining `TAO_OPERATORS_NODISCARD`:
921+
922+
```c++
923+
#define TAO_OPERATORS_NODISCARD
924+
#include <tao/operators.hpp>
925+
```
926+
915927
## Changelog
916928

929+
### 1.2.0
930+
931+
Released 2019-03-30
932+
933+
* Add support for `[[nodiscard]]`.
934+
917935
### 1.1.1
918936

919937
Released 2018-06-17

0 commit comments

Comments
 (0)