Ignore:
Timestamp:
May 24, 2014, 12:27:39 PM (9 years ago)
Author:
Peter
Message:

sort_index: add some compile tests, CONCEPT_ASSERTs, and add docs on requirements the compiler tests revealed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/sort_index.h

    r3237 r3238  
    4949     <a href=http://www.sgi.com/tech/stl/LessThanComparable.html>
    5050     LessThan Comparable</a>
     51     - \c InputIterator::value_type is
     52     <a href=http://www.sgi.com/tech/stl/DefaultConstructible.html>
     53     Default Constructible</a> and
     54     <a href=http://www.sgi.com/tech/stl/Assignable.html>
     55     Assignable</a>
    5156
    5257     \since New in yat 0.5. In versions prior 0.13 function was restricted to
    53      \forward_iterator and \c value_type of \c double.
     58     \forward_iterator with \c value_type convertible to \c double.
    5459  */
    5560  template<typename InputIterator>
     
    6671     <a href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">
    6772     Strict Weak Ordering</a>
     73     - \c Compare is
     74     <a href="http://www.sgi.com/tech/stl/Assignable.html">
     75     Assignable</a>
     76     - \c InputIterator::value_type is
     77     <a href=http://www.sgi.com/tech/stl/DefaultConstructible.html>
     78     Default Constructible</a> and
     79     <a href=http://www.sgi.com/tech/stl/Assignable.html>
     80     Assignable</a>
    6881     - \c InputIterator::value_type is convertible to \c Compare's
    6982       argument type
     
    121134    BOOST_CONCEPT_ASSERT((boost::InputIterator<InputIterator>));
    122135    typedef typename std::iterator_traits<InputIterator>::value_type T;
     136    BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<T>));
     137    BOOST_CONCEPT_ASSERT((boost::SGIAssignable<T>));
    123138    BOOST_CONCEPT_ASSERT((boost::LessThanComparable<T>));
    124139    sort_index(first, last, idx, std::less<T>());
     
    131146  {
    132147    BOOST_CONCEPT_ASSERT((boost::InputIterator<InputIterator>));
    133    
    134148    typedef typename std::iterator_traits<InputIterator> traits;
     149    typedef typename std::iterator_traits<InputIterator>::value_type T;
     150    BOOST_CONCEPT_ASSERT((boost::DefaultConstructible<T>));
     151    BOOST_CONCEPT_ASSERT((boost::SGIAssignable<T>));
     152    BOOST_CONCEPT_ASSERT((boost::Assignable<Compare>));
     153
    135154    typedef typename traits::iterator_category category;
    136155    detail::sort_index(first, last, idx, comp, category());
Note: See TracChangeset for help on using the changeset viewer.