Example #1
0
bool Foam::UList<T>::operator<(const UList<T>& a) const
{
    for
    (
        const_iterator vi = begin(), ai = a.begin();
        vi < end() && ai < a.end();
        vi++, ai++
    )
    {
        if (*vi < *ai)
        {
            return true;
        }
        else if (*vi > *ai)
        {
            return false;
        }
    }

    if (this->size_ < a.size_)
    {
        return true;
    }
    else
    {
        return false;
    }
}
Example #2
0
void Foam::stableSort(UList<T>& a, const Cmp& cmp)
{
    std::stable_sort(a.begin(), a.end(), cmp);
}
Example #3
0
void Foam::shuffle(UList<T>& a)
{
    std::random_shuffle(a.begin(), a.end());
}
Example #4
0
void Foam::stableSort(UList<T>& a)
{
    std::stable_sort(a.begin(), a.end());
}