Please revert the macros cast_unsigned and cast_signed and stick to using the static_cast<> operators - they are verbose, but are understood by any c++ programmer without additional context. Code is only written once, but read multiple times - so optimizing for the convenience of the writer is the wrong thing to optimize for.
Please revert the macros cast_unsigned and cast_signed and stick to using the static_cast<> operators - they are verbose, but are understood by any c++ programmer without additional context. Code is only written once, but read multiple times - so optimizing for the convenience of the writer is the wrong thing to optimize for.
Otherwise code LGTM and compiles. Not tested.