RFC: Split <functional> into smaller pieces
Thu Oct 13 18:20:00 GMT 2016
On 13/10/16 18:34 +0100, Jonathan Wakely wrote:
>Code which doesn't need the whole of <functional> should include the
>relevant <bits/*> header instead.
>This means that we don't need to pull the whole of <functional> (and
><vector> and <unordered_map>) into <memory> just because shared_ptr
>wants to use reference_wrapper in one place. This reduces <memory>
>from 48kloc to 30kloc!
With a few additional changes to remove <functional> from other
headers we can get:
old | new | Header
47571 | 30449 | memory
49620 | 32498 | thread
49049 | 30861 | condition_variable
49459 | 31271 | shared_mutex
54215 | 37745 | future
75063 | 68509 | regex
Apart from <regex>, which is enormous even without <functional>, these
are pretty dramatic improvements.
More information about the Libstdc++