[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs
From:       "Peter Penz" <peter.penz () gmx ! at>
Date:       2007-07-06 7:49:27
Message-ID: 20070706074927.190400 () gmx ! net
[Download RAW message or body]

Thomas Zander wrote:
> On Friday 06 July 2007 00:37:10 David Faure wrote:
> > SVN commit 684025 by dfaure:
> > 
> > it++ -> ++it, patch by Christian Spiel <e9800675 stud4 tuwien ac at>
> 
> Is there a difference? (since we are not using the output anyway).

I think it's a matter of performance, as the postincrement operator is often \
implemented with the help of the preincrement operator like this:

MyIterator MyIterator::operator++(int)
{
    MyIterator it = *this;
    ++(*this);
    return it;
}

and the preincrement operator might be implemented like this:

MyIterator& MyIterator::operator++()
{
    // ... move iterator
    return *this;
}

I did not check the corresponding implementations, so I might be wrong...

Best regards,
Peter


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic