| 2958 | */ |
| 2959 | template<typename ReferenceType, typename ThisType> |
| 2960 | static ReferenceType get_ref_impl(ThisType& obj) |
| 2961 | { |
| 2962 | // delegate the call to get_ptr<>() |
| 2963 | auto* ptr = obj.template get_ptr<typename std::add_pointer<ReferenceType>::type>(); |
| 2964 | |
| 2965 | if (JSON_HEDLEY_LIKELY(ptr != nullptr)) |
| 2966 | { |
| 2967 | return *ptr; |
| 2968 | } |
| 2969 | |
| 2970 | JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name()), obj)); |
| 2971 | } |
| 2972 | |
| 2973 | public: |
| 2974 | /// @name value access |