[Bug 93243] New: replace boost::bind with C++11 lambdas
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Aug 7 07:10:09 PDT 2015
https://bugs.documentfoundation.org/show_bug.cgi?id=93243
Bug ID: 93243
Summary: replace boost::bind with C++11 lambdas
Product: LibreOffice
Version: 5.1.0.0.alpha0+ Master
Hardware: Other
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: medium
Component: LibreOffice
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: mstahl at redhat.com
CC: libreoffice at lists.freedesktop.org
boost::bind is used to create function objects.
the bundled boost headers require a lot of patches to suppress warnings
so it would reduce the maintenance burden here to use standard C++11
features instead, and it would also make incremental rebuilds faster
whenever boost is modified/patched.
C++11 has both built-in lambda syntax to create function objects,
and std::bind in <functional> which is very similar to boost::bind.
the C++11 lambdas have the advantage that they are built-in
syntax so are the fastest to compile; they are also often
easier to read in the more complex nested boost::bind cases.
there is one obscure pit-fall here: in very rare cases the function is
passed as an argument to a preprocessor macro. lambdas may not work
in this case because the preprocessor interprets commas in the
capture list as macro argument separators and compilation fails.
use std::bind in such cases.
to find the offending code just "git grep boost::bind"
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150807/d298849e/attachment.html>
More information about the LibreOffice
mailing list