mirror of
https://github.com/boostorg/charconv.git
synced 2026-02-02 20:52:14 +00:00
@@ -9,6 +9,8 @@ This library is not an official boost library, and is under active development.
|
||||
Charconv is a collection of parsing functions that are locale-independent, non-allocating, and non-throwing.
|
||||
|
||||
````
|
||||
namespace boost { namespace charconv {
|
||||
|
||||
enum class chars_format : unsigned
|
||||
{
|
||||
scientific = 1 << 0,
|
||||
@@ -51,6 +53,8 @@ BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars<bool>(char* first, char* last,
|
||||
|
||||
template <typename Real>
|
||||
to_chars_result to_chars(char* first, char* last, Real value, chars_format fmt = chars_format::general, int precision) noexcept;
|
||||
|
||||
}} // Namespace boost::charconv
|
||||
````
|
||||
|
||||
## Notes
|
||||
|
||||
@@ -10,6 +10,8 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
== chars_format overview
|
||||
[source, c++]
|
||||
----
|
||||
namespace boost { namespace charconv {
|
||||
|
||||
enum class chars_format : unsigned
|
||||
{
|
||||
scientific = 1 << 0,
|
||||
@@ -17,6 +19,8 @@ enum class chars_format : unsigned
|
||||
hex = 1 << 2,
|
||||
general = fixed | scientific
|
||||
};
|
||||
|
||||
}} // Namespace boost::charconv
|
||||
----
|
||||
`boost::charconv::chars_format` is used to specify the format of floating point types with `from_chars` and `to_chars`.
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
== from_chars overview
|
||||
[source, c++]
|
||||
----
|
||||
namespace boost { namespace charconv {
|
||||
|
||||
struct from_chars_result
|
||||
{
|
||||
const char* ptr;
|
||||
@@ -26,6 +28,8 @@ BOOST_CXX14_CONSTEXPR from_chars_result from_chars<bool>(const char* first, cons
|
||||
|
||||
template <typename Real>
|
||||
from_chars_result from_chars(const char* first, const char* last, Real& value, chars_format fmt = chars_format::general) noexcept;
|
||||
|
||||
}} // Namespace boost::charconv
|
||||
----
|
||||
|
||||
== from_chars_result
|
||||
|
||||
@@ -10,6 +10,8 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
== to_chars overview
|
||||
[source, c++]
|
||||
----
|
||||
namespace boost { namespace charconv {
|
||||
|
||||
struct to_chars_result
|
||||
{
|
||||
char* ptr;
|
||||
@@ -27,6 +29,8 @@ BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars<bool>(char* first, char* last,
|
||||
|
||||
template <typename Real>
|
||||
to_chars_result to_chars(char* first, char* last, Real value, chars_format fmt = chars_format::general, int precision) noexcept;
|
||||
|
||||
}} // Namespace boost::charconv
|
||||
----
|
||||
|
||||
== to_chars_result
|
||||
|
||||
Reference in New Issue
Block a user