MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / create

Function create

external/json/json.hpp:13079–13096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13077 /// @}
13078
13079 private:
13080
13081 /// helper for exception-safe object creation
13082 template<typename T, typename... Args>
13083 static T* create(Args&& ... args)
13084 {
13085 AllocatorType<T> alloc;
13086 using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
13087
13088 auto deleter = [&](T * object)
13089 {
13090 AllocatorTraits::deallocate(alloc, object, 1);
13091 };
13092 std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
13093 AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...);
13094 assert(object != nullptr);
13095 return object.release();
13096 }
13097
13098 ////////////////////////
13099 // JSON value storage //

Callers 15

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
parseMethod · 0.85
sax_parseMethod · 0.85
sax_parse_internalMethod · 0.85
operator*Method · 0.85
operator->Method · 0.85
operator==Method · 0.85

Calls 2

releaseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected