Click here to Skip to main content
15,913,934 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhy is my EXE so big? Pin
Peter Weyzen21-Jan-09 11:23
Peter Weyzen21-Jan-09 11:23 
AnswerRe: Why is my EXE so big? Pin
Saurabh.Garg21-Jan-09 15:39
Saurabh.Garg21-Jan-09 15:39 
GeneralRe: Why is my EXE so big? Pin
Peter Weyzen21-Jan-09 18:15
Peter Weyzen21-Jan-09 18:15 
GeneralRe: Why is my EXE so big? Pin
Saurabh.Garg21-Jan-09 21:44
Saurabh.Garg21-Jan-09 21:44 
AnswerRe: Why is my EXE so big? Pin
Naveen21-Jan-09 16:47
Naveen21-Jan-09 16:47 
AnswerRe: Why is my EXE so big? Pin
Code-o-mat21-Jan-09 22:54
Code-o-mat21-Jan-09 22:54 
GeneralRe: Why is my EXE so big? Pin
Peter Weyzen22-Jan-09 5:57
Peter Weyzen22-Jan-09 5:57 
QuestionBinary Predicate for Templated Class Pin
mjackson1121-Jan-09 8:27
mjackson1121-Jan-09 8:27 
I created a binary predicate

// binary predicate for searching by exp date
bool exp_LT(curvePoint<double> lhs, curvePoint<double> rhs) { return (lhs.getExp() < rhs.getExp()); }

so I could search a vector by _expDate rather than _mDate on the curvePoint class:

template<class _Ty> class curvePoint : public subscriber
{
friend fwdCurve;
friend bktCurve;
public:
void setValue(_Ty p) { _mValue = p; }
_Ty getValue() { return _mValue; }
void setDate(Date d) { _mDate = d; }
inline void setDate(long d) { _mDate = d; }
Date getDate() { return _mDate; }
void setExp(Date d) { _expDate = d; }
void setExp(long d) { _expDate = d; }
Date getExp() { return _expDate; }

void update() {}

// allow self comparison
bool operator<(const curvePoint<_Ty>& rhs) const { return _mDate < rhs._mDate; }
bool operator>(const curvePoint<_Ty>& rhs) const { return _mDate > rhs._mDate; }
bool operator==(const curvePoint<_Ty>& rhs) const { return _mDate == rhs._mDate; }
bool operator!=(const curvePoint<_Ty>& rhs) const { return _mDate != rhs._mDate; }

protected:
_Ty _mValue;
Date _mDate;
Date _expDate;
};

When I call

curvePoint<double> c;
c.setExp(myDate("01/01/2009"));

i = lower_bound(vector.begin(), vector.end(), &c, exp_LT); <---- Crashes here

The compiler throws an error (C2664). The message is

1>c:\program files\microsoft visual studio 8\vc\include\xutility(312) : error C2664: 'bool (RAIV::curvePoint<_Ty>,RAIV::curvePoint<_Ty>)' : cannot convert parameter 2 from 'RAIV::curvePoint<_Ty> ' to 'RAIV::curvePoint<_Ty>'
1> with
1> [
1> _Ty=double
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous

I'm guessing the compiler cannot resolve something about the templated curvePoint<double> parameter but am at a loss as to how to proceed.
QuestionRe: Binary Predicate for Templated Class Pin
led mike21-Jan-09 10:31
led mike21-Jan-09 10:31 
AnswerRe: Binary Predicate for Templated Class Pin
Dan21-Jan-09 10:32
Dan21-Jan-09 10:32 
AnswerRe: Binary Predicate for Templated Class Pin
mjackson1121-Jan-09 11:14
mjackson1121-Jan-09 11:14 
AnswerRe: Binary Predicate for Templated Class Pin
Stephen Hewitt21-Jan-09 16:14
Stephen Hewitt21-Jan-09 16:14 
QuestionUser Defined Message to Windows Service Pin
pratap198021-Jan-09 7:51
pratap198021-Jan-09 7:51 
AnswerRe: User Defined Message to Windows Service Pin
Iain Clarke, Warrior Programmer21-Jan-09 9:23
Iain Clarke, Warrior Programmer21-Jan-09 9:23 
QuestionProblem while opening eml file with attachmenseml file with Pin
sandeepkgsmarty21-Jan-09 6:37
sandeepkgsmarty21-Jan-09 6:37 
QuestionOnMouseWheel Pin
sabapathy_8021-Jan-09 4:15
sabapathy_8021-Jan-09 4:15 
AnswerRe: OnMouseWheel Pin
Stuart Dootson21-Jan-09 4:23
professionalStuart Dootson21-Jan-09 4:23 
QuestionHow can enable child window's MenuBar Pin
Abhijit D. Babar21-Jan-09 3:48
Abhijit D. Babar21-Jan-09 3:48 
Questionhotkey for menu item not showing Pin
sabapathy_8021-Jan-09 2:57
sabapathy_8021-Jan-09 2:57 
AnswerRe: hotkey for menu item not showing Pin
Iain Clarke, Warrior Programmer21-Jan-09 3:34
Iain Clarke, Warrior Programmer21-Jan-09 3:34 
GeneralRe: hotkey for menu item not showing Pin
sabapathy_8021-Jan-09 4:07
sabapathy_8021-Jan-09 4:07 
GeneralRe: hotkey for menu item not showing Pin
Iain Clarke, Warrior Programmer21-Jan-09 4:19
Iain Clarke, Warrior Programmer21-Jan-09 4:19 
Questionnon dependent names in template base class Pin
f_jo21-Jan-09 2:45
f_jo21-Jan-09 2:45 
AnswerRe: non dependent names in template base class Pin
Sarath C21-Jan-09 3:18
Sarath C21-Jan-09 3:18 
AnswerRe: non dependent names in template base class Pin
Stuart Dootson21-Jan-09 3:45
professionalStuart Dootson21-Jan-09 3:45 

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.