Skip to content

Fix VS 2012 breakage caused by explicit operator #731

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

Closed
Dani-Hub opened this issue Jan 12, 2018 · 2 comments
Closed

Fix VS 2012 breakage caused by explicit operator #731

Dani-Hub opened this issue Jan 12, 2018 · 2 comments

Comments

@Dani-Hub
Copy link
Contributor

Pull request #695 has added an unconditional explicit conversion function to class Json::Value (See json/value.h line 404). This breaks Visual Studio 2012, which understand basic C++11, but not explicit conversion functions (These are supported since VS 2013).

The previous VS 2012 support could be restored by using a similar JSONCPP_XXX approach as has been used for override and noexcept, but this time for the explicit keyword used for conversion functions, for example by defining

#define JSONCPP_OP_EXPLICIT explicit

for fully conforming C++11 compilers and

#define JSONCPP_OP_EXPLICIT 

otherwise and then using the JSONCPP_OP_EXPLICITmacro as prefix of the operator bool declaration.

I would create a pull request for this approach, if the basic idea sounds reasonable.

Dani-Hub added a commit to Dani-Hub/jsoncpp that referenced this issue Jan 13, 2018
…to restore VS 2012 support after recent introduction of explicit conversion function in JSON::Value.
@cdunn2001
Copy link
Contributor

Let's make the special-case for the older compiler. Feel free to submit a PR.

cdunn2001 pushed a commit that referenced this issue Jan 20, 2018
…support after recent introduction of explicit conversion function in JSON::Value.
@cdunn2001
Copy link
Contributor

Oh, it was already done. Thank you!

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

No branches or pull requests

2 participants