[Fusion] value_at_c and its relatives not applicable to Associative Sequence?
Hi, the document says that 'value_at_c' accepts a Forward Sequence, and set/map, which is of Associative Sequence as well as Forward Sequence, why the following does not work? #include <boost/fusion/include/value_at.hpp> #include <boost/fusion/include/set.hpp> int main() { namespace fs = boost::fusion; typedef fs::result_of::value_at_c<fs::set<int>, 0> >::type type; return 0; }
On 3/20/2011 10:39 PM, TONGARI wrote:
Hi,
the document says that 'value_at_c' accepts a Forward Sequence, and set/map, which is of Associative Sequence as well as Forward Sequence, why the following does not work?
#include <boost/fusion/include/value_at.hpp> #include <boost/fusion/include/set.hpp>
int main() { namespace fs = boost::fusion; typedef fs::result_of::value_at_c<fs::set<int>, 0> >::type type; return 0; }
ForwardSequence does not have value_at_c, only RandomAccessSequence have that. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
On 3/21/2011 8:20 AM, Joel de Guzman wrote:
On 3/20/2011 10:39 PM, TONGARI wrote:
Hi,
the document says that 'value_at_c' accepts a Forward Sequence, and set/map, which is of Associative Sequence as well as Forward Sequence, why the following does not work?
#include <boost/fusion/include/value_at.hpp> #include <boost/fusion/include/set.hpp>
int main() { namespace fs = boost::fusion; typedef fs::result_of::value_at_c<fs::set<int>, 0> >::type type; return 0; }
ForwardSequence does not have value_at_c, only RandomAccessSequence have that.
Ok, the docs are wrong. I'm fixing it. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
On 3/21/2011 2:45 PM, TONGARI wrote:
2011/3/21 Joel de Guzman <joel@boost-consulting.com <mailto:joel@boost-consulting.com>>
Ok, the docs are wrong. I'm fixing it.
OK, also: at / at_c / value_at.
Yep. Fixed. Thanks! Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
On Mar 20, 2011, at 8:20 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
ForwardSequence does not have value_at_c, only RandomAccessSequence have that.
Makes sense. Looks like it may be a documentation bug. http://www.boost.org/doc/libs/1_46_0/libs/fusion/doc/html/fusion/sequence/in... Seq A model of Forward Sequence
participants (3)
-
Gordon Woodhull
-
Joel de Guzman
-
TONGARI