[Bug 97499] New: EasyHack: Clean up default arguments in uses of C++ unordered containers

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Feb 2 11:11:20 CET 2016


https://bugs.documentfoundation.org/show_bug.cgi?id=97499

            Bug ID: 97499
           Summary: EasyHack: Clean up default arguments in uses of C++
                    unordered containers
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: sbergman at redhat.com
                CC: libreoffice at lists.freedesktop.org

The standard C++ unordered containers (like std::unordered_map) have additional
template parameters Hash and Pred that default to std::hash<Key> and
std::equal_to<Key>, respectively.

So these can be removed where they are redundantly specified in the code base,
as in

> --- a/include/comphelper/numberedcollection.hxx
> +++ b/include/comphelper/numberedcollection.hxx
> @@ -61,9 +61,7 @@ class COMPHELPER_DLLPUBLIC NumberedCollection : private ::cppu::BaseMutex
>  
>          typedef std::unordered_map<
>                      long,
> -                    TNumberedItem,
> -                    ::std::hash<long>,
> -                    ::std::equal_to< long > > TNumberedItemHash;
> +                    TNumberedItem > TNumberedItemHash;
>  
>          typedef ::std::vector< long > TDeadItemList;
>

-- 
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/20160202/7904b35a/attachment.html>


More information about the LibreOffice mailing list