add noexcept tests
This commit is contained in:
		
							parent
							
								
									af94e712c7
								
							
						
					
					
						commit
						b56117b148
					
				
					 3 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -13,6 +13,8 @@ struct pod_bis {};
 | 
			
		|||
 | 
			
		||||
void to_json(json &, pod) noexcept;
 | 
			
		||||
void to_json(json &, pod_bis);
 | 
			
		||||
void from_json(const json&, pod) noexcept;
 | 
			
		||||
void from_json(const json&, pod_bis);
 | 
			
		||||
static json j;
 | 
			
		||||
 | 
			
		||||
static_assert(noexcept(json{}), "");
 | 
			
		||||
| 
						 | 
				
			
			@ -25,3 +27,6 @@ static_assert(not noexcept(nlohmann::to_json(j, pod_bis{})), "");
 | 
			
		|||
static_assert(noexcept(json(2)), "");
 | 
			
		||||
static_assert(noexcept(json(test{})), "");
 | 
			
		||||
static_assert(noexcept(json(pod{})), "");
 | 
			
		||||
static_assert(noexcept(j.get<pod>()), "");
 | 
			
		||||
static_assert(not noexcept(j.get<pod_bis>()), "");
 | 
			
		||||
static_assert(noexcept(json(pod{})), "");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue