|
From: | John W. Eaton |
Subject: | Re: Deprecating --enable-bounds-check? |
Date: | Thu, 11 May 2017 14:49:43 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 |
On 05/11/2017 01:16 PM, Rik wrote:
It seems reasonable to me. We could make xelem, elem, and () all do the same thing, and deprecate xelem (and possibly elem, or is there an advantage to having both operator and member function forms?).
Oops, I started looking at this and realized that I completely forgot about the other difference between xelem and elem: elem checks the reference count.
We could still eliminate bounds checking by doing the following: deprecating checkelem removing the conditional call to it in () replacing the elem method with () everywhereThen, separately, we could decide to eliminate xelem. If we eliminate it, then all uses can be replaced by using the data method to get a pointer to the underlying data vector then and indexing that directly with "[]". Doing that is probably better than using xelem anyway, because it forces you to think about whether the object is const and/or whether you want to make the representation unique instead of just ignoring the reference count completely.
What do you think? Either way, I can go ahead and do the first part now. jwe
[Prev in Thread] | Current Thread | [Next in Thread] |