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

Refactor code to allow header to be included in multiple translation units #46

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

amirkamil
Copy link
Contributor

@amirkamil amirkamil commented Apr 18, 2024

Refactor to avoid ODR violations when included csvstream.hpp from multiple translation units. Closes #33.

Simple test:

$ echo '#include "csvstream.hpp"' | g++ -std=c++11 csvstream_test.cpp -xc++ -

This fails on the main branch but succeeds with this PR.

Copy link
Owner

@awdeorio awdeorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@awdeorio awdeorio merged commit 59b85c0 into awdeorio:main Apr 19, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

separation of definition and declaration but both inside header file generates multiple definition error
2 participants