You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered that boost::bind strongly requires to have result_type meta-field from the type of the passed functional object. I was surprised, because why not to use boost::result_of when possible?
Can we fix it, even it will be a breaking change?
boost::bind predates result_of and was never updated to support it. As result_of is obsolete nowadays, if we're going to change boost::bind, we should make it use decltype directly.
That's not an entirely trivial change though, because currently objects returned by boost::bind have a fixed return type, exposed via ::result_type.
You suggest to raise up minimal standard version to C++11 here? If so, what will be a reason to use boost::bind instead of std::bind? I thought this library is a C++03 analogue of C++11's std::bind
You suggest to raise up minimal standard version to C++11 here?
On this specific instance I was thinking of using decltype when available, and retaining the current behavior when not.
If so, what will be a reason to use boost::bind instead of std::bind? I thought this library is a C++03 analogue of C++11's std::bind
boost::bind actually predates std::bind and is the source of the std::bind proposal. Much code still uses it so it would still make sense to keep it working even if we drop C++03, and it has some features that std::bind lacks, such as operators and some other subtle differences.
Or you just want to say that boost::bind is obsolete and there is no sense to resolve this issue?
boost::bind by itself may not be entirely obsolete, but I wouldn't invest much in new development targeting C++03.
Activity
pdimov commentedon Nov 7, 2022
boost::bindpredatesresult_ofand was never updated to support it. Asresult_ofis obsolete nowadays, if we're going to changeboost::bind, we should make it usedecltypedirectly.That's not an entirely trivial change though, because currently objects returned by
boost::bindhave a fixed return type, exposed via::result_type.denzor200 commentedon Nov 8, 2022
You suggest to raise up minimal standard version to C++11 here? If so, what will be a reason to use
boost::bindinstead ofstd::bind? I thought this library is a C++03 analogue of C++11'sstd::binddenzor200 commentedon Nov 8, 2022
Or you just want to say that
boost::bindis obsolete and there is no sense to resolve this issue?pdimov commentedon Nov 9, 2022
On this specific instance I was thinking of using
decltypewhen available, and retaining the current behavior when not.boost::bindactually predatesstd::bindand is the source of thestd::bindproposal. Much code still uses it so it would still make sense to keep it working even if we drop C++03, and it has some features thatstd::bindlacks, such as operators and some other subtle differences.boost::bindby itself may not be entirely obsolete, but I wouldn't invest much in new development targeting C++03.