MCPcopy Create free account
hub / github.com/Naios/function2 / retrieve

Function retrieve

include/function2/function2.hpp:485–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483/// The retriever when the object is allocated inplace
484template <typename T, typename Accessor>
485FU2_DETAIL_CXX14_CONSTEXPR auto retrieve(std::true_type /*is_inplace*/,
486 Accessor from,
487 std::size_t from_capacity) {
488 using type = transfer_const_t<Accessor, transfer_volatile_t<Accessor, void>>*;
489
490 /// Process the command by using the data inside the internal capacity
491 auto storage = &(from->inplace_storage_);
492 auto inplace = const_cast<void*>(static_cast<type>(storage));
493 return type(std::align(alignof(T), sizeof(T), inplace, from_capacity));
494}
495
496/// The retriever which is used when the object is allocated
497/// through the allocator

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected