lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Replacing boost with std C++11


From: Vadim Zeitlin
Subject: Re: [lmi] Replacing boost with std C++11
Date: Fri, 20 Jan 2017 20:25:41 +0100

On Fri, 20 Jan 2017 18:07:49 +0000 Greg Chicares <address@hidden> wrote:

GC> For the record (I couldn't figure out how to assign these
GC> commands-with-quotes-and-pipelines to env vars, so I made
GC> them into scripts):

 You won't be surprised that I would have just used Perl which has an
advantage of support a practically infinite number of quoting mechanisms.
Somewhat disappointingly, I don't even need to use it in this case, just

perl -ne 'address@hidden *# *include +<(boost/[^>]+)> address@hidden@ and 
print' *.?pp|sort|uniq

is enough (I intentionally don't output "#include" because it seems
useless, but it could, of course, be added).

GC> <boost/operators.hpp>: Item 10 in this 2002 document:
GC>   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1361.html
GC> suggests standardizing this, but I find no formal proposal.

 I haven't heard about this proposal neither, I only know of (multiple, all
rejected) proposals for comparison operators, but this wouldn't be enough
for our needs anyhow. The latest (AFAIK) paper on this subject at

   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0436r1.pdf

does mention providing full boost/operators.hpp functionality in the
language itself, but only in the "Possible future directions" section. So
this is definitely not going to be available in C++17 and I am not sure
about its chances for C++2x considering the past history...


GC> That leaves these five candidates for replacement in the near term:
GC> 
GC> #include <boost/bind.hpp>
GC> #include <boost/cast.hpp>
GC> #include <boost/scoped_ptr.hpp>
GC> #include <boost/shared_ptr.hpp>
GC> #include <boost/utility/enable_if.hpp>
GC> 
GC> We've already discussed the last three, and I'm (slowly) working on
GC> <boost/cast.hpp>. I haven't given any thought to <boost/bind.hpp>
GC> yet, but this article:
GC>   
http://stackoverflow.com/questions/10555566/difference-between-c11-stdbind-and-boostbind
GC> seems hopeful.

 I'd strongly prefer to get rid of bind() completely rather than just
replacing boost::bind with std::bind. I did use bind() enthusiastically
before, but it was just because we didn't have any better alternatives in
C++98. Now that we have lambdas, they're IMO invariably easier to both
write and read/modify. Please, let's just use them instead of dealing with
bind() and its placeholders and other warts.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]