https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99789

            Bug ID: 99789
           Summary: std::span or std::string_view are not zero-overhead on
                    MS abi
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

The issue is that on Microsoft abi, any trivially copyable type whose size is
not 1,2,4,8 bytes will be passed by pointer instead of value.

The empty object will also waste one precious register even it does nothing.

That means std::span, std::string_view etc incur extremely large overhead.

Reply via email to