[mythtv] regression with 7f00642b
Jean-Yves Avenard
jyavenard at gmail.com
Sat May 12 00:17:37 UTC 2018
The key is that they aren't nullptr. As such, the behaviour isn't undefined.
As it's called with length set to 0, it is fine.
Vector::data() is the one you would want to use though.
Get Firefox on Android
________________________________
From: Gary Buhrmaster
Sent: Friday, 11 May 2018 08:05
To: Development of MythTV
Subject: Re: [mythtv] regression with 7f00642b
On Fri, May 11, 2018 at 8:04 AM, Jean-Yves Avenard <jyavenard at gmail.com> wrote:
> On 11 May 2018 at 09:53, Jean-Yves Avenard <jyavenard at gmail.com> wrote:
>> reverse that change and pass &gdesc.front() instead
>>
>> (and &pdesc.front())
>
> actually, &*gdesc.begin() may be better.
My recollection (of the standard) is that if the
vector is empty, neither begin() nor front() are
defined and/or can be dereferenced. And these
are cases where the vector is empty.
But I would certainly defer to someone who
knows the standards better than I.
_______________________________________________
mythtv-dev mailing list
mythtv-dev at mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180511/ddda7f7e/attachment.html>
More information about the mythtv-dev
mailing list