[range] discrepancy between size and vector ::size

The following code gives me a warning: void trigger (::std ::vector < int > const &v) { ::boost ::size (v) == v. size (); } and the warning is "signed and unsigned in comparison". I understand that (size == end - begin) and that the latter expression is a difference; however, isn't the difference guaranteed to be positive? Also note that no range function ever uses range_size ::type. I suggest that ::boost ::size should return range_size ::type. Chris

Den 06-12-2011 21:40, giecrilj@stegny.2a.pl skrev:
The following code gives me a warning:
void trigger (::std ::vector< int> const&v) { ::boost ::size (v) == v. size (); }
and the warning is "signed and unsigned in comparison".
I understand that (size == end - begin) and that the latter expression is a difference; however, isn't the difference guaranteed to be positive?
We are in the process of fixing it. -Thorsten
participants (2)
-
giecrilj@stegny.2a.pl
-
Thorsten Ottosen