mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:30:05 +00:00 
			
		
		
		
	Add toolbox for radar display control
This commit is contained in:
		
							parent
							
								
									cd5d60bc0b
								
							
						
					
					
						commit
						7c606b85ff
					
				
					 8 changed files with 325 additions and 6 deletions
				
			
		
							
								
								
									
										35
									
								
								wxdata/include/scwx/util/iterator.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								wxdata/include/scwx/util/iterator.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <type_traits> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace util | ||||
| { | ||||
| 
 | ||||
| template<typename T, T beginValue, T endValue> | ||||
| class Iterator | ||||
| { | ||||
|    typedef typename std::underlying_type<T>::type value_t; | ||||
|    int                                            value_; | ||||
| 
 | ||||
| public: | ||||
|    Iterator(const T& v) : value_(static_cast<value_t>(v)) {} | ||||
|    Iterator() : value_(static_cast<value_t>(beginValue)) {} | ||||
|    Iterator operator++() | ||||
|    { | ||||
|       ++value_; | ||||
|       return *this; | ||||
|    } | ||||
|    T        operator*() { return static_cast<T>(value_); } | ||||
|    Iterator begin() { return *this; } // Default constructor
 | ||||
|    Iterator end() | ||||
|    { | ||||
|       static const Iterator endIterator = ++Iterator(endValue); | ||||
|       return endIterator; | ||||
|    } | ||||
|    bool operator!=(const Iterator& i) { return value_ != i.value_; } | ||||
| }; | ||||
| 
 | ||||
| } // namespace util
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat