std::max() vs (std::max)()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tassos Souris
    New Member
    • Aug 2008
    • 152

    std::max() vs (std::max)()

    hi!

    i was reading the Boost Library Requirements and Quidelines document and in encountered the following guideline (among similar others):
    use (std::max)() and not std::max()

    anyone knows why that?

    thanks
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    What's the context?

    (std::max)() looks like a bad cast.

    Comment

    • Tassos Souris
      New Member
      • Aug 2008
      • 152

      #3
      actually i thought that i answered back in this question..

      i found the answer the other day in another thread in bytes... http://stackoverflow.com/questions/2...calling-stdmax

      the reason is that min and max are usually defined as macros in other header files and the max must be put in parethneses [as in (std::max)] to prevent
      macro substitution...

      Comment

      Working...