sol2 icon indicating copy to clipboard operation
sol2 copied to clipboard

error: 'class sol::optional<T&>' has no member named 'construct' (gcc15)

Open trexxet opened this issue 7 months ago • 3 comments

[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

trexxet avatar Apr 29 '25 18:04 trexxet

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.

AbdullahTrees avatar May 19 '25 09:05 AbdullahTrees

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.

ensisoft avatar May 25 '25 13:05 ensisoft

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

skhaz avatar May 25 '25 13:05 skhaz