MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / create

Function create

extern/json/json.hpp:19591–19609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19589 /// @}
19590
19591 private:
19592
19593 /// helper for exception-safe object creation
19594 template<typename T, typename... Args>
19595 JSON_HEDLEY_RETURNS_NON_NULL
19596 static T* create(Args&& ... args)
19597 {
19598 AllocatorType<T> alloc;
19599 using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19600
19601 auto deleter = [&](T * obj)
19602 {
19603 AllocatorTraits::deallocate(alloc, obj, 1);
19604 };
19605 std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19606 AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19607 JSON_ASSERT(obj != nullptr);
19608 return obj.release();
19609 }
19610
19611 ////////////////////////
19612 // JSON value storage //

Callers 15

from_jsonFunction · 0.70
get_arithmetic_valueFunction · 0.70
input_adapterFunction · 0.70
start_objectFunction · 0.70
start_arrayFunction · 0.70
start_objectMethod · 0.70
start_arrayMethod · 0.70
binary_readerClass · 0.70
get_bson_stringMethod · 0.70
get_bson_binaryMethod · 0.70
parse_cbor_internalMethod · 0.70

Calls 3

constructFunction · 0.85
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected