MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / fill

Method fill

src/prevector.h:200–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198 const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
199
200 void fill(T* dst, ptrdiff_t count) {
201 if (IS_TRIVIALLY_CONSTRUCTIBLE<T>::value) {
202 // The most common use of prevector is where T=unsigned char. For
203 // trivially constructible types, we can use memset() to avoid
204 // looping.
205 ::memset(dst, 0, count * sizeof(T));
206 } else {
207 for (auto i = 0; i < count; ++i) {
208 new(static_cast<void*>(dst + i)) T();
209 }
210 }
211 }
212
213 void fill(T* dst, ptrdiff_t count, const T& value) {
214 for (auto i = 0; i < count; ++i) {

Callers 3

tinyformat.hFile · 0.80
formatImplFunction · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected