Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,591 of 33,346    |
|    =?windows-1252?Q?Daniel_Kr=FCgler?= to All    |
|    Re: std::vector |
|    15 Oct 12 21:18:52    |
      From: daniel.kruegler@googlemail.com              Am 15.10.2012 22:22, schrieb Daniel Krügler:       > Other implementations validate via an non-portable O(1) address       > test, whether the argument reference (assuming continuous container       > like std::vector) is part of the container.              Upon a second reflection I think this can be done portably given the       fact that std::less induces a total order and that all address values       within an array have a relative ordering equivalent to that of the       corresponding index values. Given this we can always detect whether       any other object pointer value is within or outside of the array.              It very rarely happens that the library provides so much stronger       guarantees about fundamental type properties, so that it is very easy       to forget that...              Greetings from Bremen,              Daniel Krügler                            --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca