Merge branch 'feature/nodiscard' into develop
This commit is contained in:
		
						commit
						e89c946451
					
				
					 7 changed files with 57 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -37,6 +37,19 @@
 | 
			
		|||
    #define JSON_DEPRECATED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// allow for portable nodiscard warnings
 | 
			
		||||
#if defined(__has_cpp_attribute)
 | 
			
		||||
    #if __has_cpp_attribute(nodiscard)
 | 
			
		||||
        #define JSON_NODISCARD [[nodiscard]]
 | 
			
		||||
    #elif __has_cpp_attribute(gnu::warn_unused_result)
 | 
			
		||||
        #define JSON_NODISCARD [[gnu::warn_unused_result]]
 | 
			
		||||
    #else
 | 
			
		||||
        #define JSON_NODISCARD
 | 
			
		||||
    #endif
 | 
			
		||||
#else
 | 
			
		||||
    #define JSON_NODISCARD
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// allow to disable exceptions
 | 
			
		||||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
 | 
			
		||||
    #define JSON_THROW(exception) throw exception
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,7 @@
 | 
			
		|||
#undef JSON_LIKELY
 | 
			
		||||
#undef JSON_UNLIKELY
 | 
			
		||||
#undef JSON_DEPRECATED
 | 
			
		||||
#undef JSON_NODISCARD
 | 
			
		||||
#undef JSON_HAS_CPP_14
 | 
			
		||||
#undef JSON_HAS_CPP_17
 | 
			
		||||
#undef NLOHMANN_BASIC_JSON_TPL_DECLARATION
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue