
-----Original Message-----
From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Richard Webb Sent: Wednesday, November 11, 2009 4:40 PM To: boost@lists.boost.org Subject: Re: [boost] Official warnings policy?
Looks like the warnings occur depending on the types used in the unit tests. For example, the warning mentioned above comes from the test code:
typedef variant< short, const char* > t_var2; typedef variant< unsigned short, const char*, t_var2 > t_var5; typedef variant< unsigned short, const char*, t_var5 > t_var6;
t_var6 v6; v6 = 58;
Which looks like a legitimate warning about converting an integer (58) to a short.
Since this is expected, could the test use a static_cast to the right type? v6 = static_cast< t_var6 >(58); Does this quiet the warning? Or must it be v6 = static_cast< unsigned short >(58); ? Either way this would document that casting/converting takes place? And perhaps users should do this too? The static_cast documents that the author has thought about this. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com