You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given how many variations there already are for this macro, and I think more proposed, I would say it would be much simpler for you to have that macro in your code, or just have your code generator write this instead:
I did already patch the codegen. Even more macros probably is not the answer. But it was pretty convenient to use the macro in source (it does not break without namespaces for some reason)
There could be a generic version of the original macro, which allows to place friend and inline parametrically, so that the two already present macros were made using one generic, but leave the option to customize.
If the maintainer is not against this idea, I could make a small PR with this change
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am making a code generator tool for defining JsonRPC types and methods
To improve compilation times there is an option to compile conversions from and to json out of line in a cpp file
The problem arises (at least on MSVC) due to NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE() having inline appended to the methods it generates:
Proof:
Such definition does not cause link error
Adding inline causes link error
The solution could be a NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE() alternative NLOHMANN_DEFINE_TYPE_OUT_OF_LINE() without the inline keyword
Beta Was this translation helpful? Give feedback.
All reactions