• Advertisement
Sign in to follow this  

no std::max() and std::min() in algorithm ?

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

the Stroustrup book says these two functions are declared in <algorithm>, but when I open that file under vc++ 2003's directory and search them, I found none. why doesn't microsoft comply with the c++ STL?

Share this post


Link to post
Share on other sites
Advertisement
According to MSDN library docs, they exist. They're probably in another header somewhere that gets included by the algorithm header.

Although my version of MSDN has the following warning in it:

Quote:
To avoid conflicts with min and max in WINDEF.H, use _MIN and _MAX instead. These macros evaluate to _cpp_min and _cpp_max, respectively.

Share this post


Link to post
Share on other sites
Quote:
Original post by digitalfreak
the Stroustrup book says these two functions are declared in <algorithm>, but when I open that file under vc++ 2003's directory and search them, I found none. why doesn't microsoft comply with the c++ STL?

I can use ::std::min an ::std::max perfectly fine in .NET 2003

Share this post


Link to post
Share on other sites
Quote:
Original post by digitalfreak
the Stroustrup book says these two functions are declared in <algorithm>, but when I open that file under vc++ 2003's directory and search them, I found none. why doesn't microsoft comply with the c++ STL?


For compatibility with previous compilers, which pre-date the standard you speak of.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement