Boost logo

Boost Users :

Subject: Re: [Boost-users] boost lambda wiht bind to stringstream::str
From: Igor R (boost.lists_at_[hidden])
Date: 2010-07-15 20:00:14


> P.S. I used this code for my checkings
>     std::string outString;
>     bl::var_type< std::string >::type _outString( bl::var(outString) );
> ...
>             _outString = bl::bind(
>
>  static_cast<std::string(std::stringstream::*)()const>(&std::stringstream::str),
>                 boost::ref(_outFmt) )(),
>             std::cout << _outString << '\n',            // Here I have
> always an empty string
>            // so the previous call to bind doesn't really return
> anything..do you know why?

Remove "()" after the bind:
static_cast<std::string(std::stringstream::*)()const>(&std::stringstream::str),
boost::ref(_outFmt) )


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