| 1548 | */ |
| 1549 | template<typename ReferenceType, typename ThisType> |
| 1550 | static ReferenceType get_ref_impl(ThisType& obj) |
| 1551 | { |
| 1552 | // delegate the call to get_ptr<>() |
| 1553 | auto* ptr = obj.template get_ptr<typename std::add_pointer<ReferenceType>::type>(); |
| 1554 | |
| 1555 | if (JSON_HEDLEY_LIKELY(ptr != nullptr)) |
| 1556 | { |
| 1557 | return *ptr; |
| 1558 | } |
| 1559 | |
| 1560 | JSON_THROW(type_error::create(303, detail::concat("incompatible ReferenceType for get_ref, actual type is ", obj.type_name()), &obj)); |
| 1561 | } |
| 1562 | |
| 1563 | public: |
| 1564 | /// @name value access |