Portable logical operators and rename variables min and max into minimum and maximum to avoid conflicts with the c++ standard library