Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-09-25 18:30:31


Larry Evans wrote:
> Both fusion list and vector specify argument types with:
>
> template <
> BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
> FUSION_MAX_LIST_SIZE, typename T, void_)
> >
> struct container_whatever;
>
> where container_whatever may be either vector or list.
>
> What's the reason for not using mpl::vector instead of
> using yet another BOOST_PP_ENUM* call and requiring
> another *_MAX_*_SIZE macro?

I can list two:

1) Preference. It has always been my preferred interface because it
    involves less typing for the user and the result looks better.
    Consider this:

        vector<int, short, char>

    versus this:

        vector<mpl::vector<int, short, char> >

    The second is redundant and involves unnecessary interface clutter.

2) Familiarity and existing practice:

    boost::tuple<int, short, char>
    boost::variant<int, short, char>
    boost::mpl::vector<int, short, char>

    I'd find it very odd if Fusion deviates from this.
    I consider Fusion a continuation of MPL and I try my best
    to follow its interface.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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