Skip to content

<array>: <array> includes too much stuff #462

@BillyONeal

Description

@BillyONeal

In @ned14 's recent STL header benchmark results, <array> stands out as the most expensive STL container header. See https://www.reddit.com/r/cpp/comments/eumou7/stl_header_token_parsing_benchmarks_for_vs2017/ . This is because <array> includes <iterator> (because reverse_iterator used to be in there?), <tuple> (because when we authored <array> the tuple interface wasn't in <type_traits> yet?), and <algorithm> (for _Swap_ranges_unchecked). These are needless overhead for the functionality <array> offers.

It probably would make sense to promote _Swap_ranges_unchecked to <xutility> or similar with all the other "optimized for trivial things" algorithms like copy,

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!throughputMust compile faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions