std::map and serialization
From: cks2k2 (cks2k2_at_discussions.microsoft.com)
Date: 12/23/04
- Next message: Frank Hickman [MVP]: "Re: WM_ACTIVATE: More Lousy Docs"
- Previous message: srVas: "Microsoft view & support in VC++"
- Next in thread: David Lowndes: "Re: std::map and serialization"
- Reply: David Lowndes: "Re: std::map and serialization"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Dec 2004 21:27:01 -0800
MFC n00b here, I'm trying to serialize a std::map obj into disk. I keep
getting compile errors with the code:
ar<<storeIt
in which ar is a CArchive obj and storeIt is the map obj's iterator (the
code above is inside a for loop that loops through the elements in the map).
My map is like this:
std::map<CString,CGPoint> with CGPoint being a class with 2 float members X
and Y. When I change my code to:
ar<<(*storeIt).first;
ar<<(*storeIt).second.X;
ar<<(*storeIt).second.Y;
it works. Is it because MFC can't serialize std::map objects directly to
file (1st code snippet) and requires each part of the map to be serialized
individually (2nd code snippet)?
- Next message: Frank Hickman [MVP]: "Re: WM_ACTIVATE: More Lousy Docs"
- Previous message: srVas: "Microsoft view & support in VC++"
- Next in thread: David Lowndes: "Re: std::map and serialization"
- Reply: David Lowndes: "Re: std::map and serialization"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading