I don't understand why the author has used static data members in the class below. Isn't that an indication that this class cannot be used in a multithreaded environment?
class boost::crc_optimal { public: // Type typedef implementation_defined value_type;
// Constants reflecting template parameters static std::size_t const bit_count = Bits; static value_type const truncated_polynominal = TruncPoly; static value_type const initial_remainder = InitRem; static value_type const final_xor_value = FinalXor; static bool const reflect_input = ReflectIn; static bool const reflect_remainder = ReflectRem;
static const integer types are all compile-time constants - they're just fine in a multithreaded environment - and IMO this is the correct way to define constants that are known at compile time (albeit C++11 adds constexpr, but it doesn't really change anything in this use case). HTH, John.