mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	BitField: Add a static_assert.
Being able to store BitField within unions requires BitField to be of standard layout, which in turn is only given if the underlying type is also has standard layout.
This commit is contained in:
		
							parent
							
								
									15ab5382a5
								
							
						
					
					
						commit
						cd1d5786d9
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -189,5 +189,6 @@ private: | ||||||
|     static_assert(position < 8 * sizeof(T), "Invalid position"); |     static_assert(position < 8 * sizeof(T), "Invalid position"); | ||||||
|     static_assert(bits <= 8 * sizeof(T), "Invalid number of bits"); |     static_assert(bits <= 8 * sizeof(T), "Invalid number of bits"); | ||||||
|     static_assert(bits > 0, "Invalid number of bits"); |     static_assert(bits > 0, "Invalid number of bits"); | ||||||
|  |     static_assert(std::is_standard_layout<T>::value, "Invalid base type"); | ||||||
| }; | }; | ||||||
| #pragma pack() | #pragma pack() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue