Closed mgieseki closed 5 years ago
Thanks for the report! I just tried it out and confirmed the issue. It either looks like my fallback implementation of is_swappable
is instantiating too eagerly, or I'm checking for is_swappable
where I shouldn't be. I'm going to be attending CppCon this week, so I'll be sure to fix this after the conference!
Awesome. Thanks for the confirmation and for having a look into the issue. Have a great time at CppCon.
Great! Thanks for fixing this issue. It works flawlessly now.
I'm experiencing something similar with gcc 7, seems to work with 8 https://godbolt.org/z/0fb-bV (also works if I use standard variant) Thanks!
The core of the issue here was that my implementation of invoke
was instantiating too much. This is fixed by 5713032c68c6dad70a6a1d9f72b80c737c249a28
First of all, thank you for providing this implementation of
std::variant
. It's great to have a lightweight alternative toboost::variant
available in C++11. I just stumbled over an issue with recursive type definitions, and I'm not sure whether it's a limitation of C++11 or the variant implementation. The following struct definition compiles fine with GCC's and Clang's C++17 support:When replacing
std::variant
withmpark::variant
, I get an error message regarding the incomplete typeS
ofstd::pair<int, S>::second
. Is it possible to enhance your implementation so that this kind of recursive type definition compiles withmpark::variant
under C++11 as well?