MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / create

Function create

native/thirdpart/json/json.hpp:15366–15384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15364 /// @}
15365
15366 private:
15367
15368 /// helper for exception-safe object creation
15369 template<typename T, typename... Args>
15370 JSON_HEDLEY_RETURNS_NON_NULL
15371 static T* create(Args&& ... args)
15372 {
15373 AllocatorType<T> alloc;
15374 using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
15375
15376 auto deleter = [&](T * object)
15377 {
15378 AllocatorTraits::deallocate(alloc, object, 1);
15379 };
15380 std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
15381 AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...);
15382 assert(object != nullptr);
15383 return object.release();
15384 }
15385
15386 ////////////////////////
15387 // JSON value storage //

Callers 15

addAgentMethod · 0.85
createStateMethod · 0.85
from_jsonFunction · 0.85
get_arithmetic_valueFunction · 0.85
start_objectMethod · 0.85
start_arrayMethod · 0.85
start_objectMethod · 0.85
start_arrayMethod · 0.85
binary_readerClass · 0.85

Calls 2

releaseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected