Sizes, signed and unsigned integers, MPL and Fusion

Hi folks, I am writing this message to bring to your attention ticket #7304 <https://svn.boost.org/trac/boost/ticket/7304> Sizes of fusion sequences are of type 'int', because it mimics MPL. However, sizes of standard containers, some of which are fusion sequences, are of type std::size_t, which is unsigned. This seems a bit inconsistent, and can lead to unexpected signed/unsigned mismatch warnings in certain scenarios. Should both MPL and Fusion be modified to use unsigned size types? I think it is best to discuss this with the whole of Boost.

On Mon, Sep 10, 2012 at 1:57 AM, Mathias Gaunard < mathias.gaunard@ens-lyon.org> wrote:
Hi folks,
I am writing this message to bring to your attention ticket #7304 <https://svn.boost.org/trac/**boost/ticket/7304<https://svn.boost.org/trac/boost/ticket/7304>
Sizes of fusion sequences are of type 'int', because it mimics MPL. However, sizes of standard containers, some of which are fusion sequences, are of type std::size_t, which is unsigned.
This seems a bit inconsistent, and can lead to unexpected signed/unsigned mismatch warnings in certain scenarios.
Should both MPL and Fusion be modified to use unsigned size types? I think it is best to discuss this with the whole of Boost.
Seems entirely reasonable to me. What was the original rationale for signed size types in MPL? Support for older compilers that could only handle int-typed compile type constants, e.g. via enum? - Jeff
participants (2)
-
Jeffrey Lee Hellrung, Jr.
-
Mathias Gaunard