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

Allow to disable inline namespaces completley #3746

Closed
2 tasks
ingo-loehken opened this issue Sep 14, 2022 · 6 comments
Closed
2 tasks

Allow to disable inline namespaces completley #3746

ingo-loehken opened this issue Sep 14, 2022 · 6 comments
Labels

Comments

@ingo-loehken
Copy link

Description

Inline namespaces do not coexist with C++/CLI. Therefore it would be great, to allow disabling inline namespaces at all.

Discussion from Microsoft Developer Community
https://developercommunity.visualstudio.com/t/ccli-bug-with-inline-namespaces-header/14964

Reproduction steps

Create a project with C++/CLI support and include any nlohmann/json Header.

Expected vs. actual results

No compiler error.

Minimal code example

No response

Error messages

compiler error: cannot reopen non inline namespace as inline

Compiler and operating system

Visual C++ 16.11.18 (Visual Studio 2019)

Library version

3.11.2

Validation

@ingo-loehken ingo-loehken changed the title Allow to disable inline namespaces completly Allow to disable inline namespaces completley Sep 14, 2022
@nlohmann nlohmann added platform: visual studio related to MSVC and removed kind: bug labels Sep 14, 2022
@nlohmann
Copy link
Owner

Removing bug label as this is a compiler bug with MSVC. We use several versions in the CI.

@falbrechtskirchinger
Copy link
Contributor

@falbrechtskirchinger
Copy link
Contributor

falbrechtskirchinger commented Sep 14, 2022

Removing bug label as this is a compiler bug with MSVC. We use several versions in the CI.

We don't test C++/CLI aka. managed C++. Do we even support non-standard C++ officially?

@nlohmann
Copy link
Owner

Sorry I missed the C++/CLI part. No, we don't test it (yet - happy to see a PR). And also no, we do not support non-standard C++.

@ingo-loehken
Copy link
Author

ingo-loehken commented Sep 15, 2022

You are right, redefining the BEGIN and END namespaces macros should be sufficient. I will test that and report back here.

@ingo-loehken
Copy link
Author

works as expected. thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants