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
There is a using namespace FASTER::core; statement in file_common.h, which causes an ambiguous references in unrelated files.
I am including FASTER as a CMake submodule (via add_subdirectory) together with other third party projects. However, both FASTER and another implement their own Thread class. As there is a using namspace FASTER::core; statement in a FASTER header, somewhere down the (compile-) line, GCC sees two Thread classes.
I get the following error when compiling the other project's files.
error: reference to ‘Thread’ is ambiguous <-- This is in the tls_thread.h file below
59 | std::unordered_map<std::thread::id, Thread::TlsList *> Thread::registry_;
...
third_party/faster/cc/src/device/../core/thread.h:19:7: note: candidates are: ‘class FASTER::core::Thread’
19 | class Thread {
...
epoch_reclaimer-src/tls_thread.h:25:7: note: ‘class Thread’
25 | class Thread : public std::thread {
By renaming FASTER's version to FasterThread, the problem is resolved. However, that is probably not the right solution. I suggest removing the using namespace statement from the header file, as recommended by Sutter, and namespace all entries within the header file correctly.
Don’t write namespace usings in a header file or before an #include
I'd be willing to create a PR for this, if you guys think this should be done.
The text was updated successfully, but these errors were encountered:
There is a
using namespace FASTER::core;
statement in file_common.h, which causes an ambiguous references in unrelated files.I am including FASTER as a CMake submodule (via
add_subdirectory
) together with other third party projects. However, both FASTER and another implement their own Thread class. As there is ausing namspace FASTER::core;
statement in a FASTER header, somewhere down the (compile-) line, GCC sees two Thread classes.I get the following error when compiling the other project's files.
By renaming FASTER's version to FasterThread, the problem is resolved. However, that is probably not the right solution. I suggest removing the
using namespace
statement from the header file, as recommended by Sutter, and namespace all entries within the header file correctly.I'd be willing to create a PR for this, if you guys think this should be done.
The text was updated successfully, but these errors were encountered: