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

Fixes compile error from pull request #14 #24

Merged
merged 1 commit into from
Jun 20, 2022
Merged

Fixes compile error from pull request #14 #24

merged 1 commit into from
Jun 20, 2022

Conversation

xenontrioxide
Copy link
Contributor

Fixes VISITABLE_DIRECT_INIT from NikolausDemmel allowing users to direct initialize with an initializer list.

Fixes VISITABLE_DIRECT_INIT from NikolausDemmel allowing users to direct initialize with an initializer list.
@NikolausDemmel
Copy link

Interesting. Can you give examples of what is different between my and your PR? IIRC initializer lists were already supported, see examples in my PR:

    VISITABLE_DIRECT_INIT(std::vector<int>, foo, {1, 2, 3});

Or is it not working as expected?

@xenontrioxide
Copy link
Contributor Author

xenontrioxide commented Jan 16, 2022

It wasn't working as expected. At least on the MSVC Compiler passing INITILIAZER... then TYPE NAME INITLIAZER was causing a compiler error where it wasn't reading the whole INITLIAZER list and was treating each comma as a separate parameter. I just changed TYPE NAME INITLIAZER to TYPE NAME __VA_ARGS__. Compiles and works fine on MSVC compiler.

The syntax is the same. The only difference is how the initializer list is handled.
0e853f4#diff-954385e2e89567be80b7357785332c3dc1daf4fc1293b537c19e5b73b9fa4cd1R401

@NikolausDemmel
Copy link

Ah ok, thanks. I didn't realize that was a GNU extension. I update my branch as well.

@cbeck88
Copy link
Owner

cbeck88 commented Jun 20, 2022

thank you! sorry for the delay

@cbeck88 cbeck88 merged commit add1752 into cbeck88:master Jun 20, 2022
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.

3 participants