Skip to content

Commit

Permalink
notes on as_ functions not doing convesions
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Oct 27, 2023
1 parent efded1d commit ae4fdf1
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions include/boost/json/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,14 @@ class value
Strong guarantee.
@throw system_error `! this->is_int64()`
@par Note
This function is intended for direct access to the underlying object,
__if__ it has the type `std::int64_t`. It does not convert the
underlying object to type `std::int64_t` even if a lossless conversion
is possible. If you are not sure which kind your `value` has, and you
only care about getting a `std::int64_t` number, consider using
@ref to_number instead.
*/
std::int64_t&
as_int64()
Expand All @@ -2662,6 +2670,14 @@ class value
Strong guarantee.
@throw system_error `! this->is_int64()`
@par Note
This function is the const-qualified overload of @ref as_int64, which
is intended for direct access to the underlying object, __if__ it has
the type `std::int64_t`. It does not convert the underlying object to
type `std::int64_t` even if a lossless conversion is possible. If you
are not sure which kind your `value` has, and you only care about
getting a `std::int64_t` number, consider using @ref to_number instead.
*/
std::int64_t
as_int64() const
Expand All @@ -2685,6 +2701,14 @@ class value
Strong guarantee.
@throw system_error `! this->is_uint64()`
@par Note
This function is intended for direct access to the underlying object,
__if__ it has the type `std::uint64_t`. It does not convert the
underlying object to type `std::uint64_t` even if a lossless conversion
is possible. If you are not sure which kind your `value` has, and you
only care about getting a `std::uint64_t` number, consider using
@ref to_number instead.
*/
std::uint64_t&
as_uint64()
Expand All @@ -2708,6 +2732,15 @@ class value
Strong guarantee.
@throw system_error `! this->is_uint64()`
@par Note
This function is the const-qualified overload of @ref as_uint64, which
is intended for direct access to the underlying object, __if__ it has
the type `std::uint64_t`. It does not convert the underlying object to
type `std::uint64_t` even if a lossless conversion is possible. If you
are not sure which kind your `value` has, and you only care about
getting a `std::uint64_t` number, consider using
@ref to_number instead.
*/
std::uint64_t
as_uint64() const
Expand All @@ -2731,6 +2764,13 @@ class value
Strong guarantee.
@throw system_error `! this->is_double()`
@par Note
This function is intended for direct access to the underlying object,
__if__ it has the type `double`. It does not convert the underlying
object to type `double` even if a lossless conversion is possible. If
you are not sure which kind your `value` has, and you only care about
getting a `double` number, consider using @ref to_number instead.
*/
double&
as_double()
Expand All @@ -2754,6 +2794,14 @@ class value
Strong guarantee.
@throw system_error `! this->is_double()`
@par Note
This function is the const-qualified overload of @ref as_double, which
is intended for direct access to the underlying object, __if__ it has
the type `double`. It does not convert the underlying object to type
`double` even if a lossless conversion is possible. If you are not sure
which kind your `value` has, and you only care about getting a `double`
number, consider using @ref to_number instead.
*/
double
as_double() const
Expand Down

0 comments on commit ae4fdf1

Please sign in to comment.