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

array::insert_at defined with TOML_API rather than TOML_EXTERNAL_LINKAGE #136

Closed
Azarael opened this issue Jan 12, 2022 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Azarael
Copy link

Azarael commented Jan 12, 2022

Environment

toml++ version and/or commit hash:
v3 - commit hash 5c5abfd

Compiler:
MSVC 2022

C++ standard mode:
latest

Target arch:
x64

Library configuration overrides:
None.

Relevant compilation flags:
None.

Describe the bug

The definition of array::insert_at in array.inl is preceded by TOML_API rather than TOML_EXTERNAL_LINKAGE (inline) as the other functions in the file are. This is causing ODR violations in my project.

@Azarael Azarael added the bug Something isn't working label Jan 12, 2022
@marzer marzer closed this as completed in 0388589 Jan 12, 2022
@marzer
Copy link
Owner

marzer commented Jan 12, 2022

Good find, thanks for the report! Fixed in the master branch.

@marzer
Copy link
Owner

marzer commented Jan 13, 2022

@Azarael It occurred to me that the reason you experienced this and I hadn't was the combination of TOML_HEADER_ONLY and including the library in multiple translation units. FYI you can improve your compile times by disabling TOML_HEADER_ONLY and defining TOML_IMPLEMENTATION in a single TU (ref: Speeding up compilation)

Having said that, I'm thankful you did experience it, so I could fix it! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants