mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Wrap all uses in min and max in extra parentheses
This prevents `min` and `max` macros from windows headers (!@#$) from breaking compilation. Related to #1191
This commit is contained in:
		@@ -27,9 +27,9 @@ namespace Catch {
 | 
			
		||||
        result_type operator()( result_type n ) const { return std::rand() % n; }
 | 
			
		||||
 | 
			
		||||
#ifdef CATCH_CONFIG_CPP11_SHUFFLE
 | 
			
		||||
        static constexpr result_type min() { return 0; }
 | 
			
		||||
        static constexpr result_type max() { return 1000000; }
 | 
			
		||||
        result_type operator()() const { return std::rand() % max(); }
 | 
			
		||||
        static constexpr result_type (min)() { return 0; }
 | 
			
		||||
        static constexpr result_type (max)() { return 1000000; }
 | 
			
		||||
        result_type operator()() const { return std::rand() % (max)(); }
 | 
			
		||||
#endif
 | 
			
		||||
        template<typename V>
 | 
			
		||||
        static void shuffle( V& vector ) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user