Skip to content

Fix VS 2012 breakage caused by explicit operator #731

Closed
@Dani-Hub

Description

@Dani-Hub

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions