On 06/27/2016 04:14 PM, Georg Baum wrote: > Guillaume Munch wrote: > >> Dear list, >> >> >> Here is a patch that removes all uses of std::bind and boost::bind in >> src/. I think this is something that we want in the long term, because >> it makes the changed code much more readable and maintainable. > You mean std::bind, or did I miss any remaining boost::bind? > >> I am conflicted about it, be cause I would like to be eventually able to >> read and maintain things that have to do with concurrency, but I would >> not like to introduce hard-to-debug crashes. It no longer crashes for >> me, but I did not understand the cause of the previous crash. >> >> Any advice? Also, since this touches a lot of sensitive code it would >> not hurt if someone offered to proof-read it. > For me personally the patch is too big to proof-read it. I'd prefer to > change simple things like > > - BufferStorage::iterator it = bstore.begin(); > - BufferStorage::iterator end = bstore.end(); > - for (; it != end; ++it) { > - Buffer * buf = *it; > + for(Buffer * buf : bstore) > > which are not related to removal of std::bind first.
Yes, that's a good idea. > Apart from that I am not too familiar with lambdas yet, so for me personally > the new code is more difficult to read than the old one ATM, and I am > probably not the only one. Your explanation to Richard is nice, but it will > soon be buried in email archives, and people reading LyX sources do not see > it. > > I am not opposed to using lambdas (I hope I can learn soemthing from you > here), but I believe that our developer documentation should contain a short > motivation why they are used in LyX (you basically explained already to > Richard how they make code more readable), and a pointer to a more detailed > introduction to lambdas. Then it should also be possible for novices or old- > timers like me to understand the new hot stuff. It wouldn't hurt to put some comments in the code, too. Richard