• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# basic_json::is_number_integer
2
3```cpp
4constexpr bool is_number_integer() const noexcept;
5```
6
7This function returns `#!cpp true` if and only if the JSON value is a signed or unsigned integer number. This excludes
8floating-point values.
9
10## Return value
11
12`#!cpp true` if type is an integer or unsigned integer number, `#!cpp false` otherwise.
13
14## Exception safety
15
16No-throw guarantee: this member function never throws exceptions.
17
18## Complexity
19
20Constant.
21
22## Example
23
24??? example
25
26    The following code exemplifies `is_number_integer()` for all JSON types.
27
28    ```cpp
29    --8<-- "examples/is_number_integer.cpp"
30    ```
31
32    Output:
33
34    ```json
35    --8<-- "examples/is_number_integer.output"
36    ```
37
38## Version history
39
40- Added in version 1.0.0.
41- Extended to also return `#!cpp true` for unsigned integers in 2.0.0.
42