Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Going the speed of light is bad for your age.


devel / comp.lang.c++ / Re: How to convert a pointer inside a vector back to an iterator ?

SubjectAuthor
* How to convert a pointer inside a vector back to an iterator ?Bonita Montero
`* Re: How to convert a pointer inside a vector back to an iterator ?Alf P. Steinbach
 `- Re: How to convert a pointer inside a vector back to an iterator ?Bonita Montero

1
How to convert a pointer inside a vector back to an iterator ?

<ubnljr$89ne$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1072&group=comp.lang.c%2B%2B#1072

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: How to convert a pointer inside a vector back to an iterator ?
Date: Fri, 18 Aug 2023 13:45:00 +0200
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <ubnljr$89ne$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 18 Aug 2023 11:44:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aea22d724f6adf17b2a10ce8004bc827";
logging-data="272110"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yDjyeZ+sx8MMBZMfPSzWIvf1Fs1CsC/k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JIUj4BLAm0YPwWTgXwd9IldIT/w=
Content-Language: de-DE
 by: Bonita Montero - Fri, 18 Aug 2023 11:45 UTC

How can I convert a pointer inside a vector back to an iterator
so that the operation is fully optimized away ? I try to use
iterators as most as possible to have iterator debugging, but
sometimes I've to work togehter with iterator debugging.

Re: How to convert a pointer inside a vector back to an iterator ?

<ubobnt$blc2$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1078&group=comp.lang.c%2B%2B#1078

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: alf.p.steinbach@gmail.com (Alf P. Steinbach)
Newsgroups: comp.lang.c++
Subject: Re: How to convert a pointer inside a vector back to an iterator ?
Date: Fri, 18 Aug 2023 20:02:36 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ubobnt$blc2$1@dont-email.me>
References: <ubnljr$89ne$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 18 Aug 2023 18:02:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3e0a6886b19baacef06df7af52a0891b";
logging-data="382338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1978k/1qcBGQFezFWPabXsw"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:ZSLvfuDeLdxhrchw4hSFlf6i0Mk=
Content-Language: en-US
In-Reply-To: <ubnljr$89ne$1@dont-email.me>
 by: Alf P. Steinbach - Fri, 18 Aug 2023 18:02 UTC

On 2023-08-18 1:45 PM, Bonita Montero wrote:
> How can I convert a pointer inside a vector back to an iterator
> so that the operation is fully optimized away ? I try to use
> iterators as most as possible to have iterator debugging, but
> sometimes I've to work togehter with iterator debugging.

Don't know about "fully optimized away".

But otherwise, `v.begin() + (p - v.data())`.

- Alf

Re: How to convert a pointer inside a vector back to an iterator ?

<uboitu$cncu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1082&group=comp.lang.c%2B%2B#1082

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: How to convert a pointer inside a vector back to an iterator ?
Date: Fri, 18 Aug 2023 22:05:18 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uboitu$cncu$1@dont-email.me>
References: <ubnljr$89ne$1@dont-email.me> <ubobnt$blc2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 18 Aug 2023 20:05:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aea22d724f6adf17b2a10ce8004bc827";
logging-data="417182"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VAU0HUDOBcyOfeXA/wRK1TXT2YiDUO7E="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:K/+vSvEeWmy3kV9ZtH7QTCbQuyU=
In-Reply-To: <ubobnt$blc2$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Fri, 18 Aug 2023 20:05 UTC

Am 18.08.2023 um 20:02 schrieb Alf P. Steinbach:
> On 2023-08-18 1:45 PM, Bonita Montero wrote:
>> How can I convert a pointer inside a vector back to an iterator
>> so that the operation is fully optimized away ? I try to use
>> iterators as most as possible to have iterator debugging, but
>> sometimes I've to work togehter with iterator debugging.
>
> Don't know about "fully optimized away".
>
> But otherwise, `v.begin() + (p - v.data())`.

If the pointer is inside a register that's optimized away and
the register is considered to be the iterator object afterwards.,

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor