consider the A5 API function al_get_bitmap_width(ALLEGRO_BITMAP* b). I assume that this function will never modify *b. Nonetheless, the API doesn't declare it as al_get_bitmap_width(const ALLEGRO_BITMAP* b), which would give usercode stronger guarantees.
Does al_get_bitmap_width really never modify the pointed-to bitmap, or does merely the API promise less than it could?
Is it feasible to make the Allegro 5 API const-correct?
I'm calling A5 through SiegeLord's DAllegro5 bindings, have D's const in my usercode wherever possible, but then have to cast the const away before calling DAllegro5. I have considered to move the responsibility to DAllegro5, but ideally, the responsibility should be with A5 itself, and its API.
I would love to see a const-correct API. This would not merely help in D usercode, but also in C, C++, ..., and should be fully backwards-compatible with the non-const-correct API.
On the other hand, once you introduce const in the A5 API, you cannot remove it without breaking bindings or usercode. I would understand if you preferred to be really careful here. Would you then suggest that the bindings guarantee const, or that I cast in usercode every time I call the bindings, or that I omit const whatsoever with anything from Allgero 5?