| 15238 | */ |
| 15239 | template<typename ReferenceType, typename ThisType> |
| 15240 | static ReferenceType get_ref_impl(ThisType& obj) |
| 15241 | { |
| 15242 | // delegate the call to get_ptr<>() |
| 15243 | auto ptr = obj.template get_ptr<typename std::add_pointer<ReferenceType>::type>(); |
| 15244 | |
| 15245 | if (JSON_LIKELY(ptr != nullptr)) |
| 15246 | { |
| 15247 | return *ptr; |
| 15248 | } |
| 15249 | |
| 15250 | JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name()))); |
| 15251 | } |
| 15252 | |
| 15253 | public: |
| 15254 | /// @name value access |