Skip to content

kf::vector resize method leads to the use of unsupported on old 32-bit systems (Windows XP-Windows 7) memcmp function #50

@maliysergey

Description

@maliysergey

If use resize method with value for integer types, for example
kf::vector<int, PagedPool> test; test.resize(10, 1);
it leads to import the memcmp function to the resulting binary.

It occurs because resize internally calls _Uninitialized_fill_n method that use _Is_all_bits_zero method
template <class _Ty> _NODISCARD bool _Is_all_bits_zero(const _Ty& _Val) { // checks if scalar type has all bits set to zero _STL_INTERNAL_STATIC_ASSERT(is_scalar_v<_Ty> && !is_member_pointer_v<_Ty>); constexpr _Ty _Zero{}; return _CSTD memcmp(&_Val, &_Zero, sizeof(_Ty)) == 0; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions