Boost logo

Boost :

Subject: Re: [boost] Sizes, signed and unsigned integers, MPL and Fusion
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-09-10 07:36:26


On Mon, Sep 10, 2012 at 1:57 AM, Mathias Gaunard <
mathias.gaunard_at_[hidden]> wrote:

> 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.
>

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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk