| 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 |