Boost logo

Boost :

From: Oleg Abrosimov (beholder_at_[hidden])
Date: 2006-06-11 07:47:37


Thank you for quick response, it solves my problem.

about my second request (wide char support in manipulators) - I've
realized that there are three preprocessor branches in fusion source,
and I've seen one that is intended for buggy compilers, so, fusion
supports wide chars, sorry for noise.

Best regards,
Oleg Abrosimov.

Joel de Guzman:
> With Fusion, this is easy. Using lambda/phoenix:
>
> fusion::for_each(tup, std::cout << _1);
>
> If you want it to be a function (using plain-ole functors):
>
> namespace detail
> {
> template <class Out>
> struct my_printer
> {
> printer(Out& out) : out(out) {}
>
> template <class T>
> void operator()(T const& val) const
> {
> out << val;
> }
> Out& out;
> };
> }
>
> template <class Out, class Tuple>
> Out& print_tuple(Out& out, Tuple const& tup)
> {
> fusion::for_each(tup, detail::my_printer<Out>(out));
> }
>
>> One more issue with fusion::tuple manipulators as they are in boost
>> 1.33.1 (unofficially): I've discovered that only narrow strings and
>> characters are supported. am I right? If so, I believe that wide
>> versions should be added too.
>
> Hmmm... Have you tried? Those are templated on Char type AFICT.
> I have to admit not testing that though. The Fusion I/O tests
> are simply those from Boost.Tuples. Added in my TODO list.
>
> Regards,


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk