Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Include headers Pin
Adam Roderick J30-Aug-09 18:19
Adam Roderick J30-Aug-09 18:19 
GeneralRe: Include headers Pin
Hamid_RT30-Aug-09 22:53
Hamid_RT30-Aug-09 22:53 
QuestionOvercoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 9:02
Sternocera30-Aug-09 9:02 
AnswerRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Richard Andrew x6430-Aug-09 11:34
professionalRichard Andrew x6430-Aug-09 11:34 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 11:43
Sternocera30-Aug-09 11:43 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 12:50
Sternocera30-Aug-09 12:50 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Richard Andrew x6430-Aug-09 13:08
professionalRichard Andrew x6430-Aug-09 13:08 
AnswerRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Stuart Dootson30-Aug-09 13:21
professionalStuart Dootson30-Aug-09 13:21 
While your hack (mentioned in another post) doesn't seem too egregious to me, another possible solution could be to add more template function overloads - I'm just showing max here:

namespace std {
template<class A>
bool max(int const& a, A const& b) { return a>b?a:b; }

template<class A>
bool max(A const& a, int const& b) { return a>b?a:b; }
}


These should take care of the cases in your header that aren't compiling with the STL min function, as (if you read the error messages) one of the types involved is always int.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Member 1235294525-Oct-20 4:58
Member 1235294525-Oct-20 4:58 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Stuart Dootson25-Oct-20 8:19
professionalStuart Dootson25-Oct-20 8:19 
QuestionDrawShadowText Pin
thanhvinh090630-Aug-09 8:29
thanhvinh090630-Aug-09 8:29 
AnswerRe: DrawShadowText Pin
Code-o-mat30-Aug-09 9:31
Code-o-mat30-Aug-09 9:31 
AnswerRe: DrawShadowText Pin
kilt3-Sep-09 4:39
kilt3-Sep-09 4:39 
QuestionCDC::DrawState [modified] Pin
thanhvinh090630-Aug-09 8:25
thanhvinh090630-Aug-09 8:25 
AnswerRe: CDC::DrawState Pin
«_Superman_»30-Aug-09 18:17
professional«_Superman_»30-Aug-09 18:17 
Questionhow to make a graphical text editor using c++??? Pin
mukulbawa30-Aug-09 8:18
mukulbawa30-Aug-09 8:18 
AnswerRe: how to make a graphical text editor using c++??? Pin
Richard Andrew x6430-Aug-09 10:12
professionalRichard Andrew x6430-Aug-09 10:12 
GeneralRe: how to make a graphical text editor using c++??? Pin
mukulbawa30-Aug-09 10:33
mukulbawa30-Aug-09 10:33 
GeneralRe: how to make a graphical text editor using c++??? Pin
Richard Andrew x6430-Aug-09 10:37
professionalRichard Andrew x6430-Aug-09 10:37 
GeneralRe: how to make a graphical text editor using c++??? Pin
Joe Woodbury30-Aug-09 11:35
professionalJoe Woodbury30-Aug-09 11:35 
GeneralRe: how to make a graphical text editor using c++??? Pin
mukulbawa31-Aug-09 7:47
mukulbawa31-Aug-09 7:47 
QuestionTO place SetCaretPos at The end of the text Pin
prithaa30-Aug-09 7:30
prithaa30-Aug-09 7:30 
GeneralRe: TO place SetCaretPos at The end of the text Pin
msn9230-Aug-09 8:17
msn9230-Aug-09 8:17 
GeneralRe: TO place SetCaretPos at The end of the text Pin
prithaa30-Aug-09 19:04
prithaa30-Aug-09 19:04 
Questionhow can i exit the program entirely? Pin
Member 3121930-Aug-09 3:45
Member 3121930-Aug-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.