mirror of
https://github.com/boostorg/json.git
synced 2026-02-20 02:42:21 +00:00
object::at is inline
This commit is contained in:
@@ -299,6 +299,36 @@ capacity() const noexcept ->
|
||||
return t_->capacity;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
//
|
||||
// Lookup
|
||||
//
|
||||
//----------------------------------------------------------
|
||||
|
||||
auto
|
||||
object::
|
||||
at(string_view key) ->
|
||||
value&
|
||||
{
|
||||
auto it = find(key);
|
||||
if(it == end())
|
||||
detail::throw_out_of_range(
|
||||
BOOST_CURRENT_LOCATION);
|
||||
return it->value();
|
||||
}
|
||||
|
||||
auto
|
||||
object::
|
||||
at(string_view key) const ->
|
||||
value const&
|
||||
{
|
||||
auto it = find(key);
|
||||
if(it == end())
|
||||
detail::throw_out_of_range(
|
||||
BOOST_CURRENT_LOCATION);
|
||||
return it->value();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
template<class P, class>
|
||||
|
||||
@@ -460,30 +460,6 @@ swap(object& other)
|
||||
//
|
||||
//----------------------------------------------------------
|
||||
|
||||
auto
|
||||
object::
|
||||
at(string_view key) ->
|
||||
value&
|
||||
{
|
||||
auto it = find(key);
|
||||
if(it == end())
|
||||
detail::throw_out_of_range(
|
||||
BOOST_CURRENT_LOCATION);
|
||||
return it->value();
|
||||
}
|
||||
|
||||
auto
|
||||
object::
|
||||
at(string_view key) const ->
|
||||
value const&
|
||||
{
|
||||
auto it = find(key);
|
||||
if(it == end())
|
||||
detail::throw_out_of_range(
|
||||
BOOST_CURRENT_LOCATION);
|
||||
return it->value();
|
||||
}
|
||||
|
||||
auto
|
||||
object::
|
||||
operator[](string_view key) ->
|
||||
|
||||
@@ -1257,7 +1257,7 @@ public:
|
||||
|
||||
@throw std::out_of_range if no such element exists.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
inline
|
||||
value&
|
||||
at(string_view key);
|
||||
|
||||
@@ -1278,7 +1278,7 @@ public:
|
||||
|
||||
@throw std::out_of_range if no such element exists.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
inline
|
||||
value const&
|
||||
at(string_view key) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user