Changeset 09416c12 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:24Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1668862
Parents:
69cc156
git-author:
Dzejrou <dzejrou@…> (2018-05-18 02:09:49)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:24)
Message:

cpp: added basic algorithm tests and fixed bugs they found

Location:
uspace/lib/cpp
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/Makefile

    r69cc156 r09416c12  
    5656        src/__bits/trycatch.cpp \
    5757        src/__bits/unwind.cpp \
     58        src/__bits/test/algorithm.cpp \
    5859        src/__bits/test/adaptors.cpp \
    5960        src/__bits/test/array.cpp \
  • uspace/lib/cpp/include/__bits/test/tests.hpp

    r69cc156 r09416c12  
    285285            void test_bind();
    286286    };
     287
     288    class algorithm_test: public test_suite
     289    {
     290        public:
     291            bool run(bool) override;
     292            const char* name() override;
     293        private:
     294            void test_non_modifying();
     295    };
    287296}
    288297
  • uspace/lib/cpp/include/impl/algorithm.hpp

    r69cc156 r09416c12  
    8888     */
    8989
    90     // TODO: Function has to be MoveConstructible
    9190    template<class InputIterator, class Function>
    9291    Function for_each(InputIterator first, InputIterator last, Function f)
     
    204203    template<class InputIterator, class Predicate>
    205204    typename iterator_traits<InputIterator>::difference_type
    206     count(InputIterator first, InputIterator last, Predicate pred)
     205    count_if(InputIterator first, InputIterator last, Predicate pred)
    207206    {
    208207        typename iterator_traits<InputIterator>::difference_type cnt{};
Note: See TracChangeset for help on using the changeset viewer.