veselink1 / refl-cpp

Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).
https://veselink1.github.io/refl-cpp/md__introduction.html
MIT License
1.05k stars 76 forks source link

Fixing builds on Apple, with xCode 12.3 and set(CMAKE_CXX_STANDARD 17). #43

Closed michaelahughes closed 3 years ago

michaelahughes commented 3 years ago
Without these changes, the Apple specific use of inline namespaces to wrap newer, 'experimental' C++ stdlib features cause compile errors with the forward declares of std::unique_ptr in refl.hpp.

Specifically, this is the error message:

/Users/mh/TransformersTCG_QT/external/src/THIRDPARTY_REFLCPP/refl.hpp:4291:67: error: reference to 'unique_ptr' is ambiguous void operator()(std::basic_ostream& os, const std::unique_ptr<T, D>& t) const ^ In file included from /Users/mh/TransformersTCG_QT/sources/widgets/mainwindow.cpp:1: In file included from /Users/mh/TransformersTCG_QT/sources/widgets/mainwindow.h:4: In file included from /Users/mh/Qt6/6.0.0/clang_64/lib/QtWidgets.framework/Headers/QMainWindow:1: In file included from /Users/mh/Qt6/6.0.0/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h:43: In file included from /Users/mh/Qt6/6.0.0/clang_64/lib/QtWidgets.framework/Headers/qtwidgetsglobal.h:43: In file included from /Users/mh/Qt6/6.0.0/clang_64/lib/QtGui.framework/Headers/qtguiglobal.h:43: In file included from /Users/mh/Qt6/6.0.0/clang_64/lib/QtCore.framework/Headers/qglobal.h:126: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:643: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2426:28: note: candidate found by name lookup is 'std::__1::unique_ptr' class _LIBCPP_TEMPLATE_VIS unique_ptr {

veselink1 commented 3 years ago

Thanks.