max

posted in Ubik
Published September 01, 2006
Advertisement
Today I discovered that this code won't compile.

#include #include int foo = std::numeric_limits::max();


However I found a few ways to make it work:
// 1#include #include int foo = (std::numeric_limits<int>::max)();// 2#define NOMINMAXinclude #include int foo = std::numeric_limits<int>::max();// 3#include #undef max#include int foo = std::numeric_limits<int>::max();// 4#include #include int foo = INT_MAX;


Yuck to C macros.
Previous Entry Terrain
Next Entry Virtual Desktops
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

XNA

1529 views

...

642 views

Physics demo

1255 views

Console launch...

1091 views

New project

1450 views

b day

1108 views

Source control

1277 views

More on Inform 7

1062 views

Logging

1208 views

Lines of code

1275 views
Advertisement