Thanks to visit codestin.com
Credit goes to github.com

Skip to content

STL: std::iter_swap can be inlined into callers #2692

@CaseyCarter

Description

@CaseyCarter

After merging P0551R3 "Thou Shalt Not Specialize std Function Templates!" users are now forbidden to explicitly specialize std::iter_swap. Consequently, we can expand calls inline into callsites for a bit of throughput and improved debug codegen / UX under as-if. Should the expansion be _Swap_adl(*a, *b);, or should we inline that as well and use swap(*a, *b); // intentional ADL? _Swap_adl is conventional, but perhaps its time to update that convention for another tiny bit of throughput?

We should see what other maintainers think about inlining _Swap_adl before wasting any effort on doing so - I'll label this [decision needed] for now.

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