Boost logo

Boost Users :

Subject: Re: [Boost-users] [Bind] Unexpected behavior when binding const char* to function
From: Igor R (boost.lists_at_[hidden])
Date: 2010-04-26 18:38:51


>   function<void ()> f = boost::bind(echo, s.c_str());

The expression x.c_str() returns a pointer that becomes invalid as
soon as any non-const member function of std::string is called for x.


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