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

transport type for toml values #78

Open
pizzard opened this issue Aug 16, 2019 · 1 comment
Open

transport type for toml values #78

pizzard opened this issue Aug 16, 2019 · 1 comment

Comments

@pizzard
Copy link

pizzard commented Aug 16, 2019

I looked around for a ini file library and found your library recently.
It seems to be exactly what I am looking for.
There is a little problem though. Including toml in all our headers would let our compile times explode, so I am looking for a way to get around that.

My current idea would be, how about if there was a separate header, containing a toml::erased_value type, and this header is absolutely minimal.
The value is defined there and only supports copy, move, and all semantic operations, but no construction besides emtpy default-construction and nothing else.
Ideally this type is not even templated.
In the main header of toml there are explicit conversion functions defined, which allow me to convert a toml::Data or toml::Value into this type and back.

Then I would be able to only include the minimal header for the erased value in my API part, keeping the compile times low.
In the few places where I actually want to parse or read the values, I would then include the full library and then do the conversion and my work.

Is such a container type easy to build? How would one do this?

@ToruNiina
Copy link
Owner

Yes, compilation time is a problem.

If I understand your point correctly, you want to have something like an <iosfwd> for this library, right?

I experimentally added it to the fwd-header branch, so take a look if you have time.

Also, in the library branch, I'm trying to add an option to build toml11 as a normal (non-header-only) library in order to reduce compilation time. It might help 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