You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the constant time versions of erase_begin and erase_end are only applied when value_type is a scalar type. However, this requirement is overly restrictive.
For example, in the case of std::pair<int, int>, the current circular_buffer requires O(n) time to perform erase_end, which is actually unnecessary.
The O(n) version of erase seems to simply destruct elements. Therefore, would it be possible to relax the condition for the fast erase versions from is_scalar<value_type> to is_trivially_destructible, allowing types like std::pair<int, int> or other user-defined simple types to benefit from the faster erase_begin and erase_end?
The text was updated successfully, but these errors were encountered:
Currently, the constant time versions of
erase_begin
anderase_end
are only applied whenvalue_type
is a scalar type. However, this requirement is overly restrictive.For example, in the case of
std::pair<int, int>
, the currentcircular_buffer
requiresO(n)
time to performerase_end
, which is actually unnecessary.The
O(n)
version of erase seems to simply destruct elements. Therefore, would it be possible to relax the condition for the fast erase versions fromis_scalar<value_type>
tois_trivially_destructible
, allowing types likestd::pair<int, int>
or other user-defined simple types to benefit from the fastererase_begin
anderase_end
?The text was updated successfully, but these errors were encountered: