C++ Logo


Advanced search

[span] Value of dynamic_extent

From: Bjorn Reese <breese_at_[hidden]>
Date: Mon, 1 Jul 2019 14:45:21 +0200
The value of dynamic_extent was orginally -1 when the extent was signed,
and now that the extent is unsigned it has become the maximum value

As the value of the extent is encoded in the mangled symbol names, the
current value of dynamic_extent generates symbol names like (using
clear() as an example)

   Itanium : _ZNKSt4spanIiLm4294967295EE5clearEv
   MSVC : ?clear@?$span_at_H$0PPPPPPPP@@std@@QEBAXXZ

In other words, the default extent generates long symbol names.

I propose that zero would be a better value for dynamic_extent. With
this value the above-mentioned symbols becomes:

   Itanium : _ZNKSt4spanIiLm0EE5clearEv
   MSVC : ?clear@?$span_at_H$0A@@std@@QEBAXXZ

In the concrete examples, this is a reduction of 9 and 7 characters
respectively for each symbol.

Received on 2019-07-01 07:47:15