News for hackers. Stuff that matters.
Re:QOI: Lossless Image Compression in O(n) Time by ur-whale on Wednesday November 24, 2021 @06:54AM (#29329090)
Packing the entire library in a header file is a somewhat recent and much welcome trend.

See for example:

https://github.com/nothings/stb

https://github.com/nothings/single_file_libs

Re:QOI: Lossless Image Compression in O(n) Time by mkl on Wednesday November 24, 2021 @07:02AM (#29329140)
I wouldn't call it recent. Boost has been doing it since it was started in the late 1990s.
Re:QOI: Lossless Image Compression in O(n) Time by flohofwoe on Wednesday November 24, 2021 @07:13AM (#29329203)
Boost or C++ stdlib headers are different than STB-style single-file-libraries though in that the implementation code is inline and needs to be parsed each time the header is included.
Re:QOI: Lossless Image Compression in O(n) Time by tommiegannert on Wednesday November 24, 2021 @08:12AM (#29329646)
Boost did it because C++ template definitions must be in headers.

That seems unrelated to this idea that C code using it is equally reasonable. That's a developer choice.

Re:QOI: Lossless Image Compression in O(n) Time by ChrisMarshallNY on Wednesday November 24, 2021 @07:07AM (#29329168)
The original C++ templates used to be entirely contained in the headers. I assume that is no longer the case, but it has been a long time, since I wrote C++.

When I was writing template SDKs, the headers were pretty much the entirety of the library.