MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / create

Function create

dependencies/json/json.hpp:17482–17500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17480 /// @}
17481
17482 private:
17483
17484 /// helper for exception-safe object creation
17485 template<typename T, typename... Args>
17486 JSON_HEDLEY_RETURNS_NON_NULL
17487 static T* create(Args&& ... args)
17488 {
17489 AllocatorType<T> alloc;
17490 using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
17491
17492 auto deleter = [&](T * object)
17493 {
17494 AllocatorTraits::deallocate(alloc, object, 1);
17495 };
17496 std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
17497 AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...);
17498 JSON_ASSERT(object != nullptr);
17499 return object.release();
17500 }
17501
17502 ////////////////////////
17503 // JSON value storage //

Callers 15

from_jsonFunction · 0.70
get_arithmetic_valueFunction · 0.70
input_adapterFunction · 0.70
start_objectMethod · 0.70
start_arrayMethod · 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 1

getMethod · 0.45

Tested by

no test coverage detected