sol2
sol2 copied to clipboard
error: 'class sol::optional<T&>' has no member named 'construct' (gcc15)
[build] build/_deps/sol-src/include/sol/optional_implementation.hpp:2194:31: error: 'class sol::optional<T&>' has no member named 'construct' [-Wtemplate-body]
[build] 2194 | this->construct(std::forward<Args>(args)...);
seems like the fix is already on the 3.5.0 tag: d805d027e0a0a7222e936926139f06e23828ce9f yet it's not released
I actually faced this bug while compiling another project. Thank you so much for pointing this out and I hope this gets fixed so I don't need to manually edit the sol2 header file myself anymore.
Confirming, same compile error,
ArchLinux, GCC 15.1.1.20250425.
Side note, whenever you write template heavy code such as sol you're guaranteed two things.
- complete dog shit compile times
- endless compiler errors due to compatibility and compiler quirks until the end of time whenever the compiler changes or a new compiler version comes out.
Cleverness has a cost.
This issue has been fixed on Conan https://github.com/conan-io/conan-center-index/blob/master/recipes/sol2/all/patches/0001-Fix-emplace.patch