Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_integer and is_float tests #90

Closed
ropuls opened this issue Jun 15, 2015 · 2 comments
Closed

is_integer and is_float tests #90

ropuls opened this issue Jun 15, 2015 · 2 comments

Comments

@ropuls
Copy link

ropuls commented Jun 15, 2015

Hi Niels,

excellent library, thanks!

would it be possible to add two more members, namely:

    inline bool is_float() const noexcept {
        return (m_type == value_t::number_float);
    }

    inline bool is_integer() const noexcept {
        return (m_type == value_t::number_integer);
    }

that would be extremly helpful when it comes to serializing json i.e. via msgpack or saving a json into mysql.

Thanks and Cheers,
Roman

@nlohmann
Copy link
Owner

I often had the same idea, but thought that nobody else would need this ;-)

@ropuls
Copy link
Author

ropuls commented Jun 15, 2015

excellent, thanks a lot!

Cheers,
R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants