Exemple #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;
    }
}
Exemple #2
0
void Foam::stableSort(UList<T>& a, const Cmp& cmp)
{
    std::stable_sort(a.begin(), a.end(), cmp);
}
Exemple #3
0
void Foam::shuffle(UList<T>& a)
{
    std::random_shuffle(a.begin(), a.end());
}
Exemple #4
0
void Foam::stableSort(UList<T>& a)
{
    std::stable_sort(a.begin(), a.end());
}