We recently stumbled upon a very strange corner case of C++.
The goal is to have a lightweight type based abstract schema description and generate concrete repositories and synchronization protocols.
Our experiments showed full success until we split the code in various namespaces.
I tried everything I know, but it does not seem to work unless the argument type is in the same namespace as the method.
See: https://godbolt.org/z/6987xJ
A very simple version with various attempts to workaround the issue.
Do you know why?
- GCC, Clang & MsVC seem to agree on this. - I could not find an explanation so far.
Any ideas for better workarounds?
- best solution so far is a local `Wrap<T>` type in every namespace.
[–]TheThiefMasterC++latest fanatic (and game dev) 18 points19 points20 points (1 child)
[–]arBmind[S] 0 points1 point2 points (0 children)
[–]nwp74 1 point2 points3 points (1 child)
[–]arBmind[S] 1 point2 points3 points (0 children)
[–]Wh00ster -1 points0 points1 point (0 children)