Hot answers tagged

4

If you aren’t reinventing the wheel as a learning exercise, and want to code this productively, the simplest options are to use the Boost version of Boost::Container::Vector<bool>, which does not specialize to a bitfield, or something like std::vector<unsigned char> or perhaps std::vector<std::byte>, letting a type the same size as bool ...


3

Makefile review: All makefiles should have .DELETE_ON_ERROR: to ensure erroneous output doesn't satisfy dependencies. The targets all, check and test should be declared as dependencies of .PHONY. It's unusual to have a Makefile for a header-only library, but I think we can still make use of default rules for the two tests: clean: $(RM) vsb_test check ...


Only top voted, non community-wiki answers of a minimum length are eligible