Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


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@lists.freedesktop.org
          Reporter: mstahl@redhat.com
                CC: libreoffice@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.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.