qprotobufmessage_cast: move static_asserts to public API


Move compile-time checks from private helper to public template
functions to provide clearer error messages with shorter stack traces.

Found during the Qt 6.11 API review.

Pick-to: 6.11
Change-Id: I298349f3e7d04349f4cd3a7e202c5626be9db805
Reviewed-by: Alexey Edelev <semlanik@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
commit31be4bc280926532660aff9989f59554d3f34ee9
parent682fb25e2b8a76d02d3c8e752227500031e4d170
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeWed, 14 Jan 2026 15:15:25 +0100