Subject: Re: [boost] [fusion] undocumented sequence requirement: convert
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-08-23 07:57:28


On 23/08/2012 05:39, Joel de Guzman wrote:

> which result_of::convert calls. Here's an example for vector:
>
> struct vector_tag;
>
> namespace extension
> {
> template <typename T>
> struct convert_impl;
>
> template <>
> struct convert_impl<vector_tag>
> {
> template <typename Sequence>
> struct apply
> {
> typedef typename
> detail::as_vector<result_of::size<Sequence>::value> gen;
> typedef typename gen::
> template apply<typename
> result_of::begin<Sequence>::type>::type
> type;
>
> static type call(Sequence& seq)
> {
> return gen::call(fusion::begin(seq));
> }
> };
> };
> }
>
> Pretty much straightforward. I think it is safe to use this extension
> mechanism. It has been stable for a long time now. Surely, that is
> not an excuse for it being undocumented though. At any rate, I
> added this in my TODO list.

Any reason not to make the vector version the default?