
On 28 April 2010 11:04, Joseph Gauterin
My point is that difference between binding to echo and echo2 (string vs. const char*) should not lead do different behavior. Otherwise user has to be very careful on signature of bind'ed function.
Passing a std::string vs a const char* to boost::bind should have as close as possible to same behaviour as passing that parameter to a normal C++ function..
To be serious: library should naturally promote its proper usage. Code like "boost::bind(echo1, "abc")" looks natural, does not emit any warning, and is dangerous. That code is safe - the lifetime of string literals is the lifetime of the program.
Good point! Yes, it's my mistake. I should have write something like that:
void f1(const string& s) {
cout << s << '\n';
}
function
Just to be clear, using char*s as strings is tricky and error prone - but that is a problem with C++, not a problem with boost. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Piotr Jachowicz