This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] Add C++ wrappers for iterating through various libdw and libdwfl objects
- From: Josh Stone <jistone at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 27 Mar 2015 09:20:39 -0700
- Subject: 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?