Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-05-21 09:29:42


Thanks Roman. Will do.

On 5/21/07, Roman Perepelitsa <roman.perepelitsa_at_[hidden]> wrote:
> Christian Henning <chhenning <at> gmail.com> writes:
>
> >
> > Thanks a lot, again.
> >
> > This is the working code now.
> > [cut]
>
> You can use transform + ostream_iterator instead of for_each + print.
>
> transform( m_data.begin()
> , m_data.end()
> , ostream_iterator<string>(cout, "\n")
> , boost::bind( &Base::to_String
> , _1
> , indent_value));
>
> And instead of handcrafted loop for indentation you can use constructor of
> std::string.
>
> virtual string to_String ( boost::uint32_t indent )
> {
> stringstream output;
> output << string(indent, ' ') << m_value;
> return output.str();
> }
>
> Roman Perepelitsa.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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