Opened 14 years ago
Closed 14 years ago
#2397 closed Feature Requests (fixed)
for_each: do not expose basic_string (implementation type)
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | Boost 1.37.0 | Component: | spirit |
Version: | Boost 1.36.0 | Severity: | Problem |
Keywords: | spirit2 symbols for_each | Cc: |
Description
symbols<Char,T>::for_each
's argument currently accepts two args:
(basic_string<Char>& str, T& val)
I know it's a slight interface change, but I think it should be changed to:
(Char const* str, T& val)
(i.e. change s
into s.c_str()
in f
calls in tst_map.hpp
and detail/tst.hpp
), since:
- if I'm not mistaken the API is
Char const*
everywhere else anyway (andbasic_string
is only used internally as afor_each
implementation detail, but is not exposed anywhere else),
- it lets the user do:
sym1.for_each(symX.add); sym2.for_each(symX.add); sym3.for_each(symX.add); ...
to merge multiple symbol tables together, which is nicer than having to write a one-line functor around symX.add
just to do the required c_str
call.
Thanks, François
Note:
See TracTickets
for help on using tickets.
Solved in Spirit2X SVN (r1090)