473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

save iterator as a DWORD

Hi all !

I have a small trouble with iterators... Can you help me please.

The problem:

typedef std::map<int, intM;
M m;
M::iterator i = m.begin();

DWORD d = (DWORD)i._Mynode();

M::iterator i2((M::_Imp::_Nodeptr)d); // <-- here i want to have an
iterator which point to same position as i

but _Nodeptr is protected type...

How to solve it ?

Alex

May 11 '07 #1
2 1825
ku*******@gmail.com wrote:
Hi all !

I have a small trouble with iterators... Can you help me please.

The problem:

typedef std::map<int, intM;
M m;
M::iterator i = m.begin();

DWORD d = (DWORD)i._Mynode();
Whatever a DWORD is, why would you want to use it to store an iterator?
A std::map::iterator is undoubtedly not a POD type.

--
Ian Collins.
May 11 '07 #2
On 2007-05-11 08:55, ku*******@gmail.com wrote:
Hi all !

I have a small trouble with iterators... Can you help me please.

The problem:

typedef std::map<int, intM;
M m;
M::iterator i = m.begin();

DWORD d = (DWORD)i._Mynode();

M::iterator i2((M::_Imp::_Nodeptr)d); // <-- here i want to have an
iterator which point to same position as i
See those methods starting with an underscore("_") followed by a capital
letter, those are reserved for the implementation and not part of any
stable interface, which basically means that you should not use them
since they can change with the smallest update to your library.

Now, if you tell us the problem (which lead you to try this solution)
someone might be able to help you with a better solution.

--
Erik Wikström
May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Lee K | last post by:
This is not strictly a C++ issue but if anyone will know the answer its you guys! I am trying to figure out a date format stored in the registry by a piece of software (I am trying to write...
7
by: __PPS__ | last post by:
Actually what I mean is that - if I have some memory buffer, lets say char a; and then I do like this: DWORD num = 0x1234; *(DWORD*)a = num; (1) *(DWORD*)(a+1) = num; (2) either...
7
by: John J. Hughes II | last post by:
I need to save a DWORD to the sql server, the below posts an error, any suggestions on what I am doing wrong. I have the column in the sql server defined as an int since unsigned int is not valid....
7
by: ±èº´¼®\( Kevin Kim \) | last post by:
Hi all __gc class Test { }; void Temp( void ) { Test *pTest = new Test;
2
by: Vladimir_petter | last post by:
Hello All, I've fount that if I compile the same program using gcc and vc 2003 the same class E (see complete source bellow) has different size (on vc it is 4 bytes bigger). Digging into this...
1
by: Gabest | last post by:
Running this piece of code while having the sse optimization turned on (vcnet2003), something really strange happens I cannot explain. Without sse it is giving me the right results. float f =...
0
by: prakash | last post by:
Dear Friends I am new guy to Visual C++.NET I've program to save website as a image vc++.net . It have a function "SaveSnapshot" to save the webpage as an image On that function ifor saving...
7
by: monkeydragon | last post by:
how to would you transfer a DWORD variable from inside of a function to the caller ex. InvokeProcessData(LPDWORD prtDW) { ... // we have created, initialized and processed // dword variable...
4
by: Rares Vernica | last post by:
Hi, How can I save a reference inside a container? For example I have: map<string, unsignedX; I would like to be able to save a reference to a position inside X. For a vector, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.