Click here to Skip to main content
15,920,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Bulk insertion into SQL Server 2005 using variables. Pin
zhu_lin23-Aug-09 22:33
zhu_lin23-Aug-09 22:33 
QuestionCStdioFile file size limit Pin
Bill Heitler18-Aug-09 11:31
Bill Heitler18-Aug-09 11:31 
AnswerRe: CStdioFile file size limit Pin
«_Superman_»18-Aug-09 20:49
professional«_Superman_»18-Aug-09 20:49 
AnswerRe: CStdioFile file size limit Pin
Joe Woodbury19-Aug-09 6:41
professionalJoe Woodbury19-Aug-09 6:41 
GeneralRe: CStdioFile file size limit Pin
Bill Heitler20-Aug-09 4:17
Bill Heitler20-Aug-09 4:17 
Questionfor loop pause resume Pin
RaymondM18-Aug-09 10:56
RaymondM18-Aug-09 10:56 
AnswerRe: for loop pause resume Pin
Nemanja Trifunovic18-Aug-09 11:06
Nemanja Trifunovic18-Aug-09 11:06 
GeneralRe: for loop pause resume Pin
RaymondM18-Aug-09 11:22
RaymondM18-Aug-09 11:22 
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 

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.