Boost logo

Boost Users :

Subject: Re: [Boost-users] boost lambda wiht bind to stringstream::str
From: Conoscenza Silente (abruzzoforteegentile_at_[hidden])
Date: 2010-07-15 19:04:14


Thanks Igor
I changed the code into this one and it builds BUT now I have SEGMANTATION
FAULT error.
Do you know what could be?

            bl::bind(

static_cast<std::string(std::stringstream::*)()const>(&std::stringstream::str),
                boost::ref(outFmt) )()

My intention is to return the call to stringstream::str() into the second
vector used by std::transform, but I am
not sure if I am achieving this.

On Fri, Jul 16, 2010 at 12:45 AM, Igor R <boost.lists_at_[hidden]> wrote:

> > Below I am using std::transform algorithm but when I try to call
> > std::stringstream::str() function using lambda::bind I receive the
> following
> > error message:
> >
> > TestBoost15Jul.cpp:49: error: no matching function for call to
> > ‘bind(<unresolved overloaded function type>, const
> > boost::reference_wrapper<std::basic_stringstream<char,
> > std::char_traits<char>, std::allocator<char> > >)’
> <...>
> > bl::bind( &std::stringstream::str , boost::ref(outFmt) )() //
> > this call to bind has some problem
> > ) );
>
> str() member function is overloaded, so you have to type-cast it
> explicitly to one of the overloads.
> _______________________________________________
> 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