RFC: Split <functional> into smaller pieces
Jonathan Wakely
jwakely@redhat.com
Fri Oct 21 15:33:00 GMT 2016
On 13/10/16 18:34 +0100, Jonathan Wakely wrote:
>This splits the large (2200 lines) <functional> header into smaller
>pieces, so there are separate headers for:
>
>- std::less, std::equal_to etc. (already in their own header)
>- std::__invoke (already in its own header)
>- std::reference_wrapper (often used on its own, e.g. in <tuple>)
>- std::function (using in <future> and <regex>)
>
>Everything else (std::mem_fn, std::bind, std::not_fn, searchers) stays
>in <functional>, because we don't actually need them elsewhere in the
>library.
>
>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!
>
>The patch is compressed because it's quite large, but it's mostly just
>moving big blocks of code from <functional> into new headers.
>
>Any objections?
Nobody objected, so I'm doing it, here's the patch.
Tested powerp64le-linux. Committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 85239 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20161021/46b57a10/attachment.bin>
More information about the Libstdc++
mailing list