distance « iterator « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » iterator » distance 

1. distance_type vs. size_type for iterator    bytes.com

cablepuff@gmail.com wrote: Alright, I am sort of confused on c++ iterators having both distance_type and size_type. > On sgi and Microsoft compiler it uses distance_type for input iterator. For mingw and cygwin it uses size_type , is it just standard issues or is it platform dependent. The Standard does not require that type 'size_type' is defined for an iterator (through its ...

2. Bidirectional iterators: signed distance?    bytes.com

nottheartistinquestion@hotmail.com As an intellectual exercise, I've implemented an STL-esque List::Iterator. Now, I would like a signed distance between two iterators which corresponds to their relative position in the list. For instance, if I did something like distance(list.end(), list.begin()), I would get -list.size(). The STL's iterator distance function amounts to something like this: distance_type distance(Iterator first, Iterator last) { distance_type n ...

3. distance between two iterators in map    bytes.com

John wrote:[color=blue] > In STL's map implementation, the distance between two > iterators it1, it2 takes O(K) to compute where K is the > actual distance between the two iterators.[/color] Where did you get this information? [color=blue] > In theory, a red black tree can do this in O(log K) time. > Anyone knows if there is a way to do ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.