Coder Social home page Coder Social logo

Comments (6)

mayah avatar mayah commented on August 22, 2024

Hi, since this library is not focusing on performance but handiness, I believe either is OK.
But yeah, std::unordered_map seems natural for this case.

from tinytoml.

veeg avatar veeg commented on August 22, 2024

Since I rely upon writing toml tables as well as parsing them, I would rather have them outputted in insertion order than random order.

from tinytoml.

mayah avatar mayah commented on August 22, 2024

@veeg yeah, it is also reasonable. However, to keep insertion order, we need to introduce something like LinkedHashMap in Java, however it's not available in STL. Another option is to use std::vector<std::pair<std::string, Value>>> for Table, but it won't be what we want to use.

from tinytoml.

mayah avatar mayah commented on August 22, 2024

Anyway, insertion order cannot be kept without introducing a bit fancy data structure.

from tinytoml.

veeg avatar veeg commented on August 22, 2024

Ahh, I'm quite forgetfull. I played around with insertion order on my local fork instead. I must have mixed up my experiences and memories regarding the matter.

from tinytoml.

iamwired avatar iamwired commented on August 22, 2024

To reduce the impact, a solution could be to limit the use of std::unordered_map to the parser? This way, the writer (that we are not using), would be unaffected. I understand it may be harder to implement though, as some code/definitions couldn't any more be shared between the two components of the library.

from tinytoml.

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.