This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add C++ wrappers for iterating through various libdw and libdwfl objects


I haven't done a full review, but I can answer one of your questions:

On 03/27/2015 07:13 AM, Mark Wielaard wrote:
>> +    cu_iterator
>> +    operator++ ()
>> +    {
>> +      move ();
>> +      return *this;
>> +    }
>> +
>> +    cu_iterator
>> +    operator++ (int)
>> +    {
>> +      cu_iterator tmp = *this;
>> +      ++*this;
>> +      return tmp;
>> +    }
> 
> This is just idiom for implementing it++?
> While the above is the ++it implementation?
> (I don't understand the (int))

That's a dummy parameter to distinguish pre- and post-increment.  See
http://en.cppreference.com/w/cpp/language/operator_incdec for example.

That page also notes that prefix forms usually return by reference.
That's not required, but any particular reason it's by value here?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]