Merge pull request #1231 from theodelrieu/feature/get_with_parameter
Add a get overload taking a parameter.
This commit is contained in:
		
						commit
						d26f39466e
					
				
					 5 changed files with 174 additions and 7 deletions
				
			
		|  | @ -298,6 +298,19 @@ TEST_CASE("basic usage", "[udt]") | |||
|             CHECK(book == parsed_book); | ||||
|         } | ||||
| 
 | ||||
|         SECTION("via explicit calls to get_to") | ||||
|         { | ||||
|             udt::person person; | ||||
|             udt::name name; | ||||
| 
 | ||||
|             json person_json = big_json["contacts"][0]["person"]; | ||||
|             CHECK(person_json.get_to(person) == sfinae_addict); | ||||
| 
 | ||||
|             // correct reference gets returned
 | ||||
|             person_json["name"].get_to(name).m_val = "new name"; | ||||
|             CHECK(name.m_val == "new name"); | ||||
|         } | ||||
| 
 | ||||
|         SECTION("implicit conversions") | ||||
|         { | ||||
|             const udt::contact_book parsed_book = big_json; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue