Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #86683

Re: attempt to dereference a singular iterator

From Paavo Helde <eesnimi@osa.pri.ee>
Newsgroups comp.lang.c++
Subject Re: attempt to dereference a singular iterator
Date 2022-09-28 19:21 +0300
Organization A noiseless patient Spider
Message-ID <th1sal$d5ak$1@dont-email.me> (permalink)
References <th1cka$4ka5$1@portraits.wsisiz.edu.pl>

Show all headers | View raw


28.09.2022 14:53 Jivanmukta kirjutas:
> I don't understand what's wrong in my code:
> 
> std::vector<std::wstring> vendor_frameworks_dirs;
> ...
> for (auto dir = vendor_frameworks_dirs.begin(); dir != 
> vendor_frameworks_dirs.end(); ++dir)
> 
> Error: attempt to dereference a singular iterator.


Most likely, the size of vendor_frameworks_dirs changes while in the 
loop, causing reallocation and invalidation of all iterators. Use 
indexes instead of iterators if this modification happens in your loop, 
or use proper mutex locks if the modification comes from another thread.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-28 13:53 +0200
  Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-28 14:18 +0200
    Re: attempt to dereference a singular iterator JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-09-28 18:53 +0300
  Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-09-28 12:19 +0000
    Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-28 17:08 +0200
      Re: attempt to dereference a singular iterator JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-09-28 18:52 +0300
        Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-29 09:42 +0200
        Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-29 11:58 +0200
          Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-09-29 11:04 +0000
      Re: attempt to dereference a singular iterator Louis Krupp <lkrupp@invalid.pssw.com.invalid> - 2022-09-29 13:23 -0600
      Re: attempt to dereference a singular iterator Sam <sam@email-scan.com> - 2022-09-29 15:39 -0400
  Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-28 19:21 +0300
    Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-29 09:58 +0200
      Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-29 15:00 +0300
        Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-29 15:59 +0200
          Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-29 17:07 +0300
            Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-29 19:15 +0200
              Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-29 22:19 +0300
                Re: attempt to dereference a singular iterator Muttley@dastardlyhq.com - 2022-09-30 13:50 +0000
                Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-30 17:04 +0300
                Re: attempt to dereference a singular iterator Muttley@dastardlyhq.com - 2022-09-30 15:03 +0000
                Re: attempt to dereference a singular iterator Louis Krupp <lkrupp@invalid.pssw.com.invalid> - 2022-09-30 11:01 -0600
                Re: attempt to dereference a singular iterator Muttley@dastardlyhq.com - 2022-10-01 09:01 +0000
                Re: attempt to dereference a singular iterator scott@slp53.sl.home (Scott Lurndal) - 2022-09-30 15:19 +0000
            Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-09-30 07:13 +0000
              Re: attempt to dereference a singular iterator Paavo Helde <eesnimi@osa.pri.ee> - 2022-09-30 15:56 +0300
                Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-30 16:21 +0200
                Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-09-30 16:09 +0000
          Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-09-30 07:12 +0000
            Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-09-30 21:05 +0200
  Re: attempt to dereference a singular iterator "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-09-30 10:36 +0200
  Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-10-03 16:53 +0200
    Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-10-04 06:02 +0000
      Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-10-05 09:42 +0200
        Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-10-06 06:55 +0000
          Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-10-07 07:34 +0200
            Re: attempt to dereference a singular iterator Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-10-07 15:20 +0200
              Re: attempt to dereference a singular iterator Juha Nieminen <nospam@thanks.invalid> - 2022-10-10 06:21 +0000
              Re: attempt to dereference a singular iterator Öö Tiib <ootiib@hot.ee> - 2022-10-10 01:03 -0700

csiph-web