Boost logo

Boost Users :

Subject: [Boost-users] [Proto] Using mpl::count as proto::transform
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-01-03 16:27:46


I have a grammar with 3 kind of terminal : A,B and C.
I want to have a transform that returns a mpl::int_ which is equal to
the number of B terminal that appear
in expression like :

A(B,B,C,B,C ..)

the grammar part for matching this is currently :

when< function< vargarg<my_grammar> >
          , mpl::count< _, terminal<B> >()
>

alas this always return 0 and so does :

when< function< vargarg<my_grammar> >
          , mpl::count< _, terminal<B>::type >()
>

as well as the same using flatten.

What do I do wrong ?

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net