Giter VIP home page Giter VIP logo

Comments (3)

pah avatar pah commented on May 21, 2024

I like the overall approach taken in the issue23errorcode branch. It's simple and effective.

Somewhat on-topic here as well (because it touches the same code parts), but rather more related to #22, I would prefer to keep a clean way to continue replacing RAPIDJSON_PARSE_ERROR with exception throwing code (as we currently use it locally). This use model is a bit more complicated now and adds unnecessary return paths, which will be dead code in case of exceptions.

We can open a new issue and provide a "standard way" to optionally use exceptions after resolving this issue.

from rapidjson.

pah avatar pah commented on May 21, 2024

Oh, and I should have mentioned that the issue23errorcode branch is affected by #26 as well.

from rapidjson.

miloyip avatar miloyip commented on May 21, 2024

I think supporting exception is possible. The dead code ("early return check") can be disabled by preprocessing.
But I don't think exception is really needed. The downside of it is performance overhead and unwinding code overhead.
Can you think of some reasons for supporting it?
If user just want to use try/catch syntax instead of calling GetParseErrorCode(), we can just throw an exception at Parse() function.

from rapidjson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.