Click here to Skip to main content
15,891,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: for loop pause resume Pin
Joe Woodbury18-Aug-09 11:13
professionalJoe Woodbury18-Aug-09 11:13 
GeneralRe: for loop pause resume Pin
RaymondM18-Aug-09 11:24
RaymondM18-Aug-09 11:24 
GeneralRe: for loop pause resume Pin
Joe Woodbury18-Aug-09 11:26
professionalJoe Woodbury18-Aug-09 11:26 
GeneralRe: for loop pause resume Pin
RaymondM23-Aug-09 7:27
RaymondM23-Aug-09 7:27 
GeneralRe: for loop pause resume Pin
Joe Woodbury23-Aug-09 8:34
professionalJoe Woodbury23-Aug-09 8:34 
QuestionPreventing a child window to change its z-order? Pin
Don Rolando18-Aug-09 10:39
Don Rolando18-Aug-09 10:39 
AnswerRe: Preventing a child window to change its z-order? Pin
Baltoro18-Aug-09 14:37
Baltoro18-Aug-09 14:37 
Questionboost bind expression not doing what I expect Pin
Stone Free18-Aug-09 8:17
Stone Free18-Aug-09 8:17 
I obviously don't get this bind stuff as I cannot seem to get it right

#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <boost/bind.hpp>

using namespace boost::bind;

typedef int DWORD;
typedef std::pair<std::string, bool> user_info;
typedef std::map<DWORD, user_info> USER_MAP;
typedef std::vector<DWORD> VEC_STAFF;



int _tmain(int argc, _TCHAR* argv[])
{
	USER_MAP m_Users;
	VEC_STAFF Staff;

	VEC_STAFF::iterator it = std::partition(Staff.begin(), Staff.end(),(bind(&USER_MAP::find, m_Users, _1) != m_Users.end()));


What I wanted to code to do is that for every entry in the Staff vector it should check to see whether that user id was present in the map, and if so move those items to the front.

I have an example using a functor that works as I hoped the above code would, but the bind version is obviously not doing what I think its doing.

struct InUsersMap : public std::unary_function<USER_MAP::key_type,bool>
{
	InUsersMap(USER_MAP & theMap, USER_MAP::const_iterator end)
		: m_theMap(theMap)
	{
	}
	inline bool operator()(CSecurePatients::USER_MAP::key_type& id) const
	{
		return m_theMap.find(id) != m_theMap.end();
	}
private:
	const USER_MAP &m_theMap;
}


Finally does anyone know how to avoid getting the socket bind function from windows being included
Question.Net and unmanaged C++ (executing thread & exception handling) Pin
Ahmed Charfeddine18-Aug-09 6:48
Ahmed Charfeddine18-Aug-09 6:48 
AnswerRe: .Net and unmanaged C++ (executing thread & exception handling) Pin
Joe Woodbury18-Aug-09 11:14
professionalJoe Woodbury18-Aug-09 11:14 
QuestionHow to enumerate remote socket ports Pin
MarkLTX18-Aug-09 6:26
MarkLTX18-Aug-09 6:26 
AnswerRe: How to enumerate remote socket ports Pin
Ahmed Charfeddine18-Aug-09 6:51
Ahmed Charfeddine18-Aug-09 6:51 
AnswerRe: How to enumerate remote socket ports Pin
Rajesh R Subramanian18-Aug-09 7:05
professionalRajesh R Subramanian18-Aug-09 7:05 
AnswerRe: How to enumerate remote socket ports Pin
MarkLTX18-Aug-09 8:16
MarkLTX18-Aug-09 8:16 
AnswerRe: How to enumerate remote socket ports Pin
Adam Maras18-Aug-09 17:43
Adam Maras18-Aug-09 17:43 
QuestionGDI+ ImageAttributes::SetColorMatrix and ColorMatrix scope Pin
bob1697218-Aug-09 5:30
bob1697218-Aug-09 5:30 
QuestionStoredProcedure SqlServer Pin
sarathbabununna18-Aug-09 3:50
sarathbabununna18-Aug-09 3:50 
QuestionLsaEnumerateLogonSessions error code Pin
Eikthrynir18-Aug-09 3:03
Eikthrynir18-Aug-09 3:03 
AnswerRe: LsaEnumerateLogonSessions error code Pin
KarstenK18-Aug-09 3:52
mveKarstenK18-Aug-09 3:52 
QuestionProgressBar on Modeless dialog box not working properly. Pin
Le@rner18-Aug-09 1:57
Le@rner18-Aug-09 1:57 
AnswerRe: ProgressBar on Modeless dialog box not working properly. Pin
«_Superman_»18-Aug-09 2:07
professional«_Superman_»18-Aug-09 2:07 
QuestionI want Source code this program Pin
Jaynarol18-Aug-09 1:46
Jaynarol18-Aug-09 1:46 
AnswerRe: I want Source code this programe Pin
CPallini18-Aug-09 1:50
mveCPallini18-Aug-09 1:50 
GeneralRe: I want Source code this programe Pin
Jaynarol18-Aug-09 1:58
Jaynarol18-Aug-09 1:58 
AnswerRe: I want Source code this program Pin
Cedric Moonen18-Aug-09 2:11
Cedric Moonen18-Aug-09 2:11 

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.