Add explanation about C++14 [[deprecated]] standard attribute (#49)

* Add [[deprecated]] attribute to C++14
This commit is contained in:
Tulio Leao
2019-06-18 17:13:00 -03:00
committed by Anthony Calandra
parent 1c60839a11
commit 9f21a120f0
2 changed files with 21 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ C++14 includes the following new language features:
- [decltype(auto)](#decltypeauto)
- [relaxing constraints on constexpr functions](#relaxing-constraints-on-constexpr-functions)
- [variable templates](#variable-templates)
- [\[\[deprecated\]\] attribute](#deprecated-attribute)
C++14 includes the following new library features:
- [user-defined literals for standard library types](#user-defined-literals-for-standard-library-types)
@@ -146,6 +147,15 @@ template<class T>
constexpr T e = T(2.7182818284590452353);
```
### [[deprecated]] attribute
C++14 introduces the `[[deprecated]]` attribute to indicate that a unit (function, class, etc) is discouraged and likely yield compilation warnings. If a reason is provided, it will be included in the warnings.
```c++
[[deprecated]]
void old_method();
[[deprecated("Use new_method instead")]]
void legacy_method();
```
## C++14 Library Features
### User-defined literals for standard library types