Error compilling result.hpp on apple-clang.
Linux Compier: GCC 11 Mac Compiler: latest apple-clang
The resulting code works on linux / gcc, but on mac I get:
/result.hpp:3524:82: error: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~' [-Werror,-Wdtor-name]
inline RESULT_INLINE_VISIBILITY RESULT_NS_IMPL::detail::result_union<T, E, false>::~result_union() noexcept(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
::result_union
https://stackoverflow.com/questions/68751682/is-a-class-templates-name-in-scope-for-a-qualified-out-of-line-destructors-def
This change fixes for me:
RESULT_NS_IMPL::detail::result_union<T,E,false>
::~result_union()
should read:
RESULT_NS_IMPL::detail::result_union<T,E,false>
::~result_union<T,E,false>()
Thanks for opening this issue.
Funny, the StackOverflow question you linked is actually my question that I asked, researched, and answered regarding this exact problem; I just forgot to follow-up on this. 😅
I'll make this change shortly.
Also my apologies for missing this when it was opened; I apparently need to update my notification preferences.
@tcanabrava Are you interested in making the PR for this? If not or if you don't respond in the following days, I'll be happy to do it.
I also don't mind making this change since it's basically a 1-line fix. The only thing that stopped me was CI failures since it's been a long time since I've updated everything.
I prefer having the safety net of CI to tell me when changes aren't accepted for older compilers, since some of them are "quirky", in what they deem to be valid C++.