sol2
sol2 copied to clipboard
Parts of the documentation out of date
Hi, first I want to express my gratitude for this wonderful library! It's almost indistinguishable from magic :)
The documentation is also very good IMO, I've only noticed a few parts that are out of date:
For example, https://sol2.readthedocs.io/en/latest/compilation.html talks about
possibly taking advantage of whatever C++17 features are made available by the compilers
or
formally make the library a C++17 one
but the current README (https://github.com/ThePhD/sol2/tree/develop?tab=readme-ov-file#supported-compilers) suggests that sol3 already is a C++17 library.
https://sol2.readthedocs.io/en/latest/features.html also refers to sol as a C++14 library. The feature matrix does not mention Lua 5.4 btw.
Another small example: https://sol2.readthedocs.io/en/latest/performance.html refers to a 2015 machine as recent :)
I can try to find more examples if that's helpful.
but the current README (https://github.com/ThePhD/sol2/tree/develop?tab=readme-ov-file#supported-compilers) suggests that sol3 already is a C++17 library.
There's one particular thing that really bugs me in the README and that is: sol2 is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). sol2 aims to be easy to use and easy to add to a project. The library is header-only for easy integration with projects, and a single header can be used for drag-and-drop start up.
It's not header-only, it's headers-only with all those headers in the include/sol folder!
It's not header-only, it's headers-only with all those headers in the include/sol folder!
A "header-only library" is a library that is implemented only in header files. It does not mean that it consists of a single header file! I don't know where you got that idea from... Personally, I have never seen anyone make a distinction between "header-only" and "headers-only". I don't even see how such a distinction would be useful.
It's not header-only, it's headers-only with all those headers in the include/sol folder!
A "header-only library" is a library that is implemented only in header files. It does not mean that it consists of a single header file! I don't know where you got that idea from... Personally, I have never seen anyone make a distinction between "header-only" and "headers-only". I don't even see how such a distinction would be useful.
It confused the hell out of me, that's all! Because whenever i've seen header-only libraries, they've all been a single header, this is the first time i've stumbled onto this type of header-only library! Like i said in my original comment it just bugs me, don't sweat it 👍
Because whenever i've seen header-only libraries, they've all been a single header, this is the first time i've stumbled onto this type of header-only library!
I see! Actually, there are many header-only libraries like this. For example, most boost libraries are header-only and they all consist of multiple header files. Another very popular header-only library is ASIO, which again consists of many, many header files.
EDIT: would you mind hiding your comments as "resolved"? I well then do the same for my replies.
There's a readme bug as well:
You can grab a single header (and the single forward header) out of the library here. For stable version, check the releases tab on GitHub for a provided single header file for maximum ease of use. A script called single.py is provided in the repository if there's some bleeding edge change that hasn't been published on the releases page.
You can't actually grab the header through that link, you need to run the script.
There is an issue with making it by CMake also. Fixed here: https://github.com/ThePhD/sol2/pull/1683
You can grab a single header (and the single forward header) out of the library here.