This is the mail archive of the mailing list for the GDB 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 v2 31/31] Support an "unlimited" number of user-defined arguments

On 10/19/2016 06:39 PM, Philipp Rudo wrote:
> Pedro Alves <> wrote:

>>>> I also needed a way to convert a number to a std::string, so I added a
>>>> new utility for that, gdb::to_string.  Yet another thing that can go
>>>> away with C++11.
>>> [... snip ...]
>>>> +/* Returns a string representation of VAL.  Replacement for
>>>> +   std::to_string, which is only available in C++11 or later.  */
>>> Is this really necessary?
>>> As far as I understood the discussion, we jump directly to C++11. Thus there is no need for an homemade to_string.
>> We haven't actually officially committed to requiring
>> C++11, so I didn't want to be blocked by that.  It's
>> trivial to remove that bit latter if this lands first.
> True that C++11 is not official yet. But the "trivial to remove" is
> exactly the reason I wrote, as those pieces of code tend to stay in the longest.
> And in 10+ years nobody knows why there is such a messy mix of different
> functions doing the same thing and why it hasn't been done right in the
> first place ;)

Well, in this case the comment leaves no doubt.  :-)

> So my mail should not push you to use std::to_string but be seen as a reminder,
> that if we require C++11 your home made function should be deleted better sooner
> than later.

Agreed.  If this lands first, I'll make sure to remove this piece
after C++11.

Pedro Alves

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