mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-04 05:04:27 +02:00
Updated FAQ (markdown)
2
FAQ.md
2
FAQ.md
@@ -52,7 +52,7 @@ The syntax is slightly more verbose in that you have to explicitly convert the `
|
||||
1. Convert `Tuesday[3]/m/y` (`year_month_weekday`) to `sys_days` in order to add `days`.
|
||||
2. Convert the `sys_days` to a `year_month_day`.
|
||||
|
||||
2 conversions. Roughly twice as fast!
|
||||
2 conversions. Roughly twice as fast! And the code generation (using clang++ -O3) is roughly half the size: 152 assembly statements vs 335 assembly statements.
|
||||
|
||||
This philosophy is similar to that which we have for containers: It would be super easy to create `vector<T>::push_front(const T&)`. But that would make it too easy for programmers to write inefficient code. The compiler helps remind the programmer that perhaps `deque<T>` or `list<T>` would be a better choice when he attempts to code with `vector<T>::push_front(const T&)`.
|
||||
|
||||
|
Reference in New Issue
Block a user