MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / assign

Method assign

system/lib/libcxx/include/__vector/vector.h:1080–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078
1079template <class _Tp, class _Allocator>
1080_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) {
1081 if (__n <= capacity()) {
1082 size_type __s = size();
1083 std::fill_n(this->__begin_, std::min(__n, __s), __u);
1084 if (__n > __s)
1085 __construct_at_end(__n - __s, __u);
1086 else
1087 this->__destruct_at_end(this->__begin_ + __n);
1088 } else {
1089 __vdeallocate();
1090 __vallocate(__recommend(static_cast<size_type>(__n)));
1091 __construct_at_end(__n, __u);
1092 }
1093}
1094
1095template <class _Tp, class _Allocator>
1096_LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::reserve(size_type __n) {

Callers 15

makeCallExpressionFunction · 0.45
IdentifierFunction · 0.45
createStreamFunction · 0.45
statfsNodeFunction · 0.45
resetPrototypeFunction · 0.45
#elseFunction · 0.45
mergeIntoFunction · 0.45
addToCompileTimeContextFunction · 0.45
applySettingsFunction · 0.45
loadDefaultSettingsFunction · 0.45
initFunction · 0.45

Calls 5

capacityFunction · 0.85
__vallocateFunction · 0.70
sizeFunction · 0.50
fill_nFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected