mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	file_util: Check for is_trivially_copyable
Also applies the template checks to ReadArray as well.
This commit is contained in:
		
							parent
							
								
									3ee4432fe3
								
							
						
					
					
						commit
						bf9945b81b
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -192,6 +192,9 @@ public: | |||
|     template <typename T> | ||||
|     size_t ReadArray(T* data, size_t length) | ||||
|     { | ||||
|         static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); | ||||
|         static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); | ||||
| 
 | ||||
|         if (!IsOpen()) { | ||||
|             m_good = false; | ||||
|             return -1; | ||||
|  | @ -207,9 +210,8 @@ public: | |||
|     template <typename T> | ||||
|     size_t WriteArray(const T* data, size_t length) | ||||
|     { | ||||
|         static_assert(std::is_standard_layout<T>::value, "Given array does not consist of standard layout objects"); | ||||
|         // TODO: gcc 4.8 does not support is_trivially_copyable, but we really should check for it here.
 | ||||
|         //static_assert(std::is_trivially_copyable<T>::value, "Given array does not consist of trivially copyable objects");
 | ||||
|         static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects"); | ||||
|         static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects"); | ||||
| 
 | ||||
|         if (!IsOpen()) { | ||||
|             m_good = false; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue