Remove non-std lib example.

This commit is contained in:
Anthony Calandra
2016-11-03 21:20:53 -07:00
parent c80f3b6251
commit 624dcf4e8a

View File

@@ -430,14 +430,6 @@ factorial(5); // == 120
### User-defined literals for standard library types ### User-defined literals for standard library types
New user-defined literals for standard library types, including new built-in literals for `chrono` and `basic_string`. These can be `constexpr` meaning they can be used at compile-time. Some uses for these literals include compile-time integer parsing, binary literals, and imaginary number literals. New user-defined literals for standard library types, including new built-in literals for `chrono` and `basic_string`. These can be `constexpr` meaning they can be used at compile-time. Some uses for these literals include compile-time integer parsing, binary literals, and imaginary number literals.
```c++ ```c++
constexpr int operator"" _test(unsigned long long x) {
return 0;
}
123_test; // == 0
```
Built in literals for `chrono`:
```c++
using namespace std::chrono_literals; using namespace std::chrono_literals;
auto day = 24h; auto day = 24h;
day.count(); // == 24 day.count(); // == 24