[#BloombergLP-bdljsn-JsonNumber-2constructor-031] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonNumber.adoc[JsonNumber]::JsonNumber :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdljsn_jsonnumber.h>` Create a `JsonNumber` having the value "0". Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonNumber/2constructor-0fa.adoc[JsonNumber](); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0fa.adoc[_» more..._]# Create a `JsonNumber` object having the same value and the same allocator as the specified `original` object. The value of `original` becomes unspecified but valid, and its allocator remains unchanged. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d0.adoc[JsonNumber](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonNumber>] original) noexcept; ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d0.adoc[_» more..._]# Create a `JsonNumber` object having the same value and the same allocator as the specified `text`. The contents of the `value` string becomes unspecified but valid, and its allocator remains unchanged. The behavior is undefined unless `isValidNumber(text)` is `true`. See {JSON Textual Specification}. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-05e1.adoc[JsonNumber](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<bsl::string>] text); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-05e1.adoc[_» more..._]# Create a `JsonNumber` having the value "0" that uses the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0c.adoc[JsonNumber](xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0c.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0e1.adoc[JsonNumber]( xref:BloombergLP/bdldfp/Decimal64.adoc[bdldfp::Decimal64] value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0e1.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d5.adoc[JsonNumber]( double value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d5.adoc[_» more..._]# Create a `JsonNumber` having the specified `value`. Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. The behavior is undefined if the `value` is infinite (`INF`) or not‐a‐number (`NaN`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-01.adoc[JsonNumber]( float value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-01.adoc[_» more..._]# Create a `JsonNumber` having the specified `value`. Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0f6.adoc[JsonNumber]( int value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0f6.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-05e2.adoc[JsonNumber]( long value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-05e2.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-06.adoc[JsonNumber]( long long value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-06.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0ef.adoc[JsonNumber]( unsigned int value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0ef.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d9.adoc[JsonNumber]( unsigned long value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d9.adoc[_» more..._]# Create a `JsonNumber` having the specified `value`. Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-055.adoc[JsonNumber]( unsigned long long value, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-055.adoc[_» more..._]# Create a `JsonNumber` object having the same value as the specified `original` object, using the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. The allocator of `original` remains unchanged. If `original` and the newly created object have the same allocator then the value of `original` becomes unspecified but valid, and no exceptions will be thrown; otherwise `original` is unchanged (and an exception may be thrown). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d4.adoc[JsonNumber]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonNumber>] original, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0d4.adoc[_» more..._]# Create a `JsonNumber` object having the same value as the specified `text`, using the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. The allocator of the `text` string remains unchanged. If the `text` and the newly created object have the same allocator then the contents of `text` string becomes unspecified but valid, and no exceptions will be thrown; otherwise the `text` string is unchanged and an exception may be thrown. The behavior is undefined unless `isValidNumber(text)` is `true`. See {JSON Textual Specification}. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-0e6.adoc[JsonNumber]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<bsl::string>] text, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-0e6.adoc[_» more..._]# Create a `JsonNumber` object having the same value as the specified `original` object. Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonNumber/2constructor-052.adoc[JsonNumber]( xref:BloombergLP/bdljsn/JsonNumber.adoc[JsonNumber] const& original, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-052.adoc[_» more..._]# Same as the related overload above for `JsonNumber`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-00.adoc[JsonNumber]( std::string_view const& text, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-00.adoc[_» more..._]# Create a `JsonNumber` having the value of the specified `text`. Optionally specify an `allocator` (e.g., the address of a `bslma::Allocator` object) used to supply memory. The behavior is undefined unless `isValidJsonNumber(text)` is `true`. See {JSON Textual Specification}. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/JsonNumber/2constructor-03c.adoc[JsonNumber]( char const* text, xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator_type] const& allocator = allocator_type()); ---- [.small]#xref:BloombergLP/bdljsn/JsonNumber/2constructor-03c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#