@@ -136,29 +136,16 @@ class ProtoValue {
136136 T const * get () const ;
137137
138138 // / @brief Return a reference to the underlying T, without checking.
139- // / @tparam T a bool or double
140139 template <typename T>
141- std::enable_if_t <std::is_scalar<T>{}, T&> get_unchecked ();
142-
143- // / @brief Return the underlying T by value, without checking.
144- // / @tparam T a bool or double.
145- template <typename T>
146- std::enable_if_t <std::is_scalar<T>{}, T> get_unchecked () const ;
147-
148- // / @brief Return a mutable reference to the underlying T, without checking
149- // / @tparam T a std::string, ProtoList, or ProtoStruct.
150- template <typename T>
151- std::enable_if_t <!std::is_scalar<T>{}, T&> get_unchecked () &;
140+ T& get_unchecked () &;
152141
153142 // / @brief Return an immutable reference to the underlying T, without checking.
154- // / @tparam T a std::string, ProtoList, or ProtoStruct.
155143 template <typename T>
156- std:: enable_if_t <!std::is_scalar<T>{}, T const &> get_unchecked () const &;
144+ const T& get_unchecked () const &;
157145
158146 // / @brief Return an rvalue reference to the underlying T, without checking.
159- // / @tparam T a std::string, ProtoList, or ProtoStruct.
160147 template <typename T>
161- std:: enable_if_t <!std::is_scalar<T>{}, T&&> get_unchecked () &&;
148+ T&& get_unchecked() &&;
162149
163150 // /@}
164151
@@ -295,22 +282,21 @@ extern template ProtoValue::ProtoValue(ProtoList) noexcept(
295282extern template ProtoValue::ProtoValue(ProtoStruct m) noexcept (
296283 std::is_nothrow_move_constructible<ProtoStruct>{});
297284
298- // -- Template specialization declarations of get_unchecked: POD types -- //
299- extern template bool & ProtoValue::get_unchecked<bool >();
300- extern template double & ProtoValue::get_unchecked<double >();
301-
302- extern template bool ProtoValue::get_unchecked<bool >() const ;
303- extern template double ProtoValue::get_unchecked<double >() const ;
304-
305- // -- Template specialization declarations of get_unchecked: string and recursive types -- //
285+ // -- Template specialization declarations of get_unchecked -- //
286+ extern template bool & ProtoValue::get_unchecked<bool >() &;
287+ extern template double & ProtoValue::get_unchecked<double >() &;
306288extern template std::string& ProtoValue::get_unchecked<std::string>() &;
307289extern template ProtoList& ProtoValue::get_unchecked<ProtoList>() &;
308290extern template ProtoStruct& ProtoValue::get_unchecked<ProtoStruct>() &;
309291
292+ extern template bool const & ProtoValue::get_unchecked<bool >() const &;
293+ extern template double const & ProtoValue::get_unchecked<double >() const &;
310294extern template std::string const & ProtoValue::get_unchecked<std::string>() const &;
311295extern template ProtoList const & ProtoValue::get_unchecked<ProtoList>() const &;
312296extern template ProtoStruct const & ProtoValue::get_unchecked<ProtoStruct>() const &;
313297
298+ extern template bool && ProtoValue::get_unchecked<bool >() &&;
299+ extern template double && ProtoValue::get_unchecked<double >() &&;
314300extern template std::string&& ProtoValue::get_unchecked<std::string>() &&;
315301extern template ProtoList&& ProtoValue::get_unchecked<ProtoList>() &&;
316302extern template ProtoStruct&& ProtoValue::get_unchecked<ProtoStruct>() &&;
0 commit comments