|
Boost : |
From: Joel de Guzman (joel_at_[hidden])
Date: 2007-11-21 17:20:22
Dean Michael Berris wrote:
> So the idea is to use fusion::at_c<>() which I've been trying to avoid
> precisely because this static assert will fail:
>
> BOOST_STATIC_ASSERT((
> boost::is_same<
> boost::result_of<select<0>(std::pair<int, int>)>::type,
> int
> >::value
> ));
>
> This I think is because Fusion's at_c<>::type will return 'int const
> &' which is correct behavior as far as fusion goes, but not what I
> intend with the current implementation of select<> which is to return
> copies and not references. Perhaps it's going to be good to rethink
> this decision, and come up with select<> and select_copy<>.
>
That's not a const-correctness problem. Fusion /at/ will return
int& which is the correct exact type that the at(s) function
returns.
See my other post. Use /value_at/ if you want the actual value! :-)
HTH,
-- 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