I’m porting a lock-free container from C to C++. I’m now considering templating the class and using only one file so that the final user doesn’t have to go through the trouble of linking my lib. He would only have to include the template file.
I’m not sure if I’m doing the right thing though. Is this good practice?
This is pretty common; Boost and many other C++ libraries are designed as header-only (though some parts of Boost need compilation). The same was true for the STL, which is now merged into the standard library.