forked from eden-emu/eden
		
	fixed_point: Mark copy/move assignment operators and constructors as constexpr
Given these are just moving a raw value around, these can sensibly be made constexpr to make the interface more useful.
This commit is contained in:
		
							parent
							
								
									278826ce5b
								
							
						
					
					
						commit
						9cc6234265
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -268,9 +268,12 @@ public: | ||||||
| 
 | 
 | ||||||
| public: // constructors
 | public: // constructors
 | ||||||
|     FixedPoint() = default; |     FixedPoint() = default; | ||||||
|     FixedPoint(const FixedPoint&) = default; | 
 | ||||||
|     FixedPoint(FixedPoint&&) noexcept = default; |     constexpr FixedPoint(const FixedPoint&) = default; | ||||||
|     FixedPoint& operator=(const FixedPoint&) = default; |     constexpr FixedPoint& operator=(const FixedPoint&) = default; | ||||||
|  | 
 | ||||||
|  |     constexpr FixedPoint(FixedPoint&&) noexcept = default; | ||||||
|  |     constexpr FixedPoint& operator=(FixedPoint&&) noexcept = default; | ||||||
| 
 | 
 | ||||||
|     template <IsArithmetic Number> |     template <IsArithmetic Number> | ||||||
|     constexpr FixedPoint(Number n) : data_(static_cast<base_type>(n * one)) {} |     constexpr FixedPoint(Number n) : data_(static_cast<base_type>(n * one)) {} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lioncash
						Lioncash