Changeset fbec99a in mainline


Ignore:
Timestamp:
2018-07-05T21:41:18Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86f7bc6
Parents:
5209fd7
git-author:
Jaroslav Jindrak <dzejrou@…> (2017-11-08 21:25:07)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:18)
Message:

cpp: added missing return statements and fixed return types on operators caused by bad copypastas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/string.hpp

    r5209fd7 rfbec99a  
    563563                    swap(tmp);
    564564                }
     565
     566                return *this;
    565567            }
    566568
     
    571573                if (this != &other)
    572574                    swap(other);
     575
     576                return *this;
    573577            }
    574578
     
    16931697
    16941698    template<class Char, class Traits, class Allocator>
    1695     basic_string<Char, Traits, Allocator>
    1696     operator==(const basic_string<Char, Traits, Allocator>& lhs,
    1697                const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1699    bool operator==(const basic_string<Char, Traits, Allocator>& lhs,
     1700                    const basic_string<Char, Traits, Allocator>& rhs) noexcept
    16981701    {
    16991702        return lhs.compare(rhs) == 0;
     
    17011704
    17021705    template<class Char, class Traits, class Allocator>
    1703     basic_string<Char, Traits, Allocator>
    1704     operator==(const Char* lhs,
    1705                const basic_string<Char, Traits, Allocator>& rhs)
     1706    bool operator==(const Char* lhs,
     1707                    const basic_string<Char, Traits, Allocator>& rhs)
    17061708    {
    17071709        return rhs == lhs;
     
    17091711
    17101712    template<class Char, class Traits, class Allocator>
    1711     basic_string<Char, Traits, Allocator>
    1712     operator==(const basic_string<Char, Traits, Allocator>& lhs,
    1713                const Char* rhs)
     1713    bool operator==(const basic_string<Char, Traits, Allocator>& lhs,
     1714                    const Char* rhs)
    17141715    {
    17151716        return lhs.compare(rhs) == 0;
     
    17211722
    17221723    template<class Char, class Traits, class Allocator>
    1723     basic_string<Char, Traits, Allocator>
    1724     operator!=(const basic_string<Char, Traits, Allocator>& lhs,
    1725                const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1724    bool operator!=(const basic_string<Char, Traits, Allocator>& lhs,
     1725                    const basic_string<Char, Traits, Allocator>& rhs) noexcept
    17261726    {
    17271727        return !(lhs == rhs);
     
    17291729
    17301730    template<class Char, class Traits, class Allocator>
    1731     basic_string<Char, Traits, Allocator>
    1732     operator!=(const Char* lhs,
    1733                const basic_string<Char, Traits, Allocator>& rhs)
     1731    bool operator!=(const Char* lhs,
     1732                    const basic_string<Char, Traits, Allocator>& rhs)
    17341733    {
    17351734        return rhs != lhs;
     
    17371736
    17381737    template<class Char, class Traits, class Allocator>
    1739     basic_string<Char, Traits, Allocator>
    1740     operator!=(const basic_string<Char, Traits, Allocator>& lhs,
    1741                const Char* rhs)
     1738    bool operator!=(const basic_string<Char, Traits, Allocator>& lhs,
     1739                    const Char* rhs)
    17421740    {
    17431741        return lhs.compare(rhs) != 0;
     
    17491747
    17501748    template<class Char, class Traits, class Allocator>
    1751     basic_string<Char, Traits, Allocator>
    1752     operator<(const basic_string<Char, Traits, Allocator>& lhs,
    1753               const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1749    bool operator<(const basic_string<Char, Traits, Allocator>& lhs,
     1750                   const basic_string<Char, Traits, Allocator>& rhs) noexcept
    17541751    {
    17551752        return lhs.compare(rhs) < 0;
     
    17571754
    17581755    template<class Char, class Traits, class Allocator>
    1759     basic_string<Char, Traits, Allocator>
    1760     operator<(const Char* lhs,
    1761               const basic_string<Char, Traits, Allocator>& rhs)
     1756    bool operator<(const Char* lhs,
     1757                   const basic_string<Char, Traits, Allocator>& rhs)
    17621758    {
    17631759        return rhs.compare(lhs) > 0;
     
    17651761
    17661762    template<class Char, class Traits, class Allocator>
    1767     basic_string<Char, Traits, Allocator>
    1768     operator<(const basic_string<Char, Traits, Allocator>& lhs,
    1769               const Char* rhs)
     1763    bool operator<(const basic_string<Char, Traits, Allocator>& lhs,
     1764                   const Char* rhs)
    17701765    {
    17711766        return lhs.compare(rhs) < 0;
     
    17771772
    17781773    template<class Char, class Traits, class Allocator>
    1779     basic_string<Char, Traits, Allocator>
    1780     operator>(const basic_string<Char, Traits, Allocator>& lhs,
    1781               const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1774    bool operator>(const basic_string<Char, Traits, Allocator>& lhs,
     1775                   const basic_string<Char, Traits, Allocator>& rhs) noexcept
    17821776    {
    17831777        return lhs.compare(rhs) > 0;
     
    17851779
    17861780    template<class Char, class Traits, class Allocator>
    1787     basic_string<Char, Traits, Allocator>
    1788     operator>(const Char* lhs,
    1789               const basic_string<Char, Traits, Allocator>& rhs)
     1781    bool operator>(const Char* lhs,
     1782                   const basic_string<Char, Traits, Allocator>& rhs)
    17901783    {
    17911784        return rhs.compare(lhs) < 0;
     
    17931786
    17941787    template<class Char, class Traits, class Allocator>
    1795     basic_string<Char, Traits, Allocator>
    1796     operator>(const basic_string<Char, Traits, Allocator>& lhs,
    1797               const Char* rhs)
     1788    bool operator>(const basic_string<Char, Traits, Allocator>& lhs,
     1789                   const Char* rhs)
    17981790    {
    17991791        return lhs.compare(rhs) > 0;
     
    18051797
    18061798    template<class Char, class Traits, class Allocator>
    1807     basic_string<Char, Traits, Allocator>
    1808     operator<=(const basic_string<Char, Traits, Allocator>& lhs,
    1809                const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1799    bool operator<=(const basic_string<Char, Traits, Allocator>& lhs,
     1800                    const basic_string<Char, Traits, Allocator>& rhs) noexcept
    18101801    {
    18111802        return lhs.compare(rhs) <= 0;
     
    18131804
    18141805    template<class Char, class Traits, class Allocator>
    1815     basic_string<Char, Traits, Allocator>
    1816     operator<=(const Char* lhs,
    1817                const basic_string<Char, Traits, Allocator>& rhs)
     1806    bool operator<=(const Char* lhs,
     1807                    const basic_string<Char, Traits, Allocator>& rhs)
    18181808    {
    18191809        return rhs.compare(lhs) >= 0;
     
    18211811
    18221812    template<class Char, class Traits, class Allocator>
    1823     basic_string<Char, Traits, Allocator>
    1824     operator<=(const basic_string<Char, Traits, Allocator>& lhs,
    1825                const Char* rhs)
     1813    bool operator<=(const basic_string<Char, Traits, Allocator>& lhs,
     1814                    const Char* rhs)
    18261815    {
    18271816        return lhs.compare(rhs) <= 0;
     
    18331822
    18341823    template<class Char, class Traits, class Allocator>
    1835     basic_string<Char, Traits, Allocator>
    1836     operator>=(const basic_string<Char, Traits, Allocator>& lhs,
    1837                const basic_string<Char, Traits, Allocator>& rhs) noexcept
     1824    bool operator>=(const basic_string<Char, Traits, Allocator>& lhs,
     1825                    const basic_string<Char, Traits, Allocator>& rhs) noexcept
    18381826    {
    18391827        return lhs.compare(rhs) >= 0;
     
    18411829
    18421830    template<class Char, class Traits, class Allocator>
    1843     basic_string<Char, Traits, Allocator>
    1844     operator>=(const Char* lhs,
    1845                const basic_string<Char, Traits, Allocator>& rhs)
     1831    bool operator>=(const Char* lhs,
     1832                    const basic_string<Char, Traits, Allocator>& rhs)
    18461833    {
    18471834        return rhs.compare(lhs) <= 0;
     
    18491836
    18501837    template<class Char, class Traits, class Allocator>
    1851     basic_string<Char, Traits, Allocator>
    1852     operator>=(const basic_string<Char, Traits, Allocator>& lhs,
    1853                const Char* rhs)
     1838    bool operator>=(const basic_string<Char, Traits, Allocator>& lhs,
     1839                    const Char* rhs)
    18541840    {
    18551841        return lhs.compare(rhs) >= 0;
Note: See TracChangeset for help on using the changeset viewer.