Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CView/ new line Pin
Nibu babu thomas25-Mar-07 18:58
Nibu babu thomas25-Mar-07 18:58 
GeneralRe: CView/ new line Pin
_808625-Mar-07 19:25
_808625-Mar-07 19:25 
QuestionHow can i change CTreeCtrl properties in run time ? Pin
Yanshof25-Mar-07 18:09
Yanshof25-Mar-07 18:09 
AnswerRe: How can i change CTreeCtrl properties in run time ? [modified] Pin
Parthi_Appu25-Mar-07 18:54
Parthi_Appu25-Mar-07 18:54 
QuestionItem's problem of states and action Pin
Chen-XuNuo25-Mar-07 17:44
Chen-XuNuo25-Mar-07 17:44 
AnswerRe: Item's problem of states and action Pin
Nibu babu thomas25-Mar-07 19:13
Nibu babu thomas25-Mar-07 19:13 
GeneralRe: Item's problem of states and action Pin
Chen-XuNuo26-Mar-07 4:09
Chen-XuNuo26-Mar-07 4:09 
QuestionSTL trickery [modified] Pin
User 58385225-Mar-07 16:07
User 58385225-Mar-07 16:07 
Im working on a piece of code that stores objects and manages subscriptions to these objects, each object can have multiple subscriptions and each subscription can relate to multiple objects. Both objects and individual subscriptions are identified by an int ID

I have an STL map of MyObjects keyed by their integer id
std::map< int, MyObject > mObjects; //objects for which there is at least one subscription


I have an STL map that maps an object id to a list of subscription id's that relate to that object
std::map< int, std::set< int > > mSubscriptions;  subscription list by object id


I get passed a subscription id to remove. What I need to do is look at the mSubscriptions map and remove each occurance of the subscription id. Then if any object is left with zero subscription id's I need to remove it from the mSubscriptions map all together and remove the object from mObjects map.

I can do this with a few loops but I'm sure it could be done better by using std::remove_copy_if() to remove the subscription id from mSubscriptions and return a vector of the object id's that now have no assosiated subscriptions. I could then use that vector of object id's to remove them from mObjects

Can anyone give me a few pointers on how to code the predicate to pass to std::remove_copy_if() to achieve this?

What I'm having trouble with is the fact mSubscriptions::value_type is a pair< > and I want to copy the .second member into my vector

-- modified at 22:21 Sunday 25th March, 2007


System.IO.Path.IsPathRooted() does not behave as I would expect

AnswerRe: STL trickery Pin
Stephen Hewitt25-Mar-07 17:42
Stephen Hewitt25-Mar-07 17:42 
GeneralRe: STL trickery Pin
User 58385225-Mar-07 20:24
User 58385225-Mar-07 20:24 
GeneralRe: STL trickery Pin
Stephen Hewitt25-Mar-07 20:42
Stephen Hewitt25-Mar-07 20:42 
GeneralRe: STL trickery Pin
User 58385225-Mar-07 20:57
User 58385225-Mar-07 20:57 
GeneralRe: STL trickery Pin
Stephen Hewitt25-Mar-07 21:10
Stephen Hewitt25-Mar-07 21:10 
GeneralRe: STL trickery Pin
User 58385225-Mar-07 21:19
User 58385225-Mar-07 21:19 
GeneralRe: STL trickery Pin
Stephen Hewitt25-Mar-07 21:51
Stephen Hewitt25-Mar-07 21:51 
QuestionDual Core Processor With Visual C++ 2005 Express edition Pin
ForNow25-Mar-07 16:04
ForNow25-Mar-07 16:04 
AnswerRe: Dual Core Processor With Visual C++ 2005 Express edition Pin
Christian Graus25-Mar-07 16:10
protectorChristian Graus25-Mar-07 16:10 
GeneralRe: Dual Core Processor With Visual C++ 2005 Express edition Pin
ForNow25-Mar-07 16:21
ForNow25-Mar-07 16:21 
AnswerRe: Dual Core Processor With Visual C++ 2005 Express edition Pin
Manticorr25-Mar-07 17:15
Manticorr25-Mar-07 17:15 
GeneralRe: Dual Core Processor With Visual C++ 2005 Express edition Pin
ForNow26-Mar-07 6:36
ForNow26-Mar-07 6:36 
QuestionApplication - Service Communication [modified] Pin
Gurkenscheibe25-Mar-07 11:12
Gurkenscheibe25-Mar-07 11:12 
AnswerRe: Application - Service Communication Pin
Programm3r25-Mar-07 20:56
Programm3r25-Mar-07 20:56 
GeneralRe: Application - Service Communication Pin
Gurkenscheibe26-Mar-07 10:43
Gurkenscheibe26-Mar-07 10:43 
GeneralRe: Application - Service Communication Pin
JudyL_MD26-Mar-07 2:20
JudyL_MD26-Mar-07 2:20 
GeneralRe: Application - Service Communication Pin
Gurkenscheibe26-Mar-07 10:41
Gurkenscheibe26-Mar-07 10:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.