MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / get_ref_impl

Function get_ref_impl

lesson6-Segmentation/json.hpp:19301–19312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19299 */
19300 template<typename ReferenceType, typename ThisType>
19301 static ReferenceType get_ref_impl(ThisType& obj)
19302 {
19303 // delegate the call to get_ptr<>()
19304 auto ptr = obj.template get_ptr<typename std::add_pointer<ReferenceType>::type>();
19305
19306 if (JSON_HEDLEY_LIKELY(ptr != nullptr))
19307 {
19308 return *ptr;
19309 }
19310
19311 JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name())));
19312 }
19313
19314 public:
19315 /// @name value access

Callers

nothing calls this directly

Calls 1

createFunction · 0.85

Tested by

no test coverage detected