🚨 fixed a compiler warning #1224
This commit is contained in:
		
							parent
							
								
									d713727f22
								
							
						
					
					
						commit
						eb30ff0615
					
				
					 4 changed files with 4 additions and 17 deletions
				
			
		|  | @ -230,11 +230,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test. | |||
| */ | ||||
| #define NLOHMANN_JSON_HAS_HELPER(type)                                        \ | ||||
|     template<typename T> struct has_##type {                                  \ | ||||
|     private:                                                                  \ | ||||
|         template<typename U, typename = typename U::type>                     \ | ||||
|         static int detect(U &&);                                              \ | ||||
|         static void detect(...);                                              \ | ||||
|     public:                                                                   \ | ||||
|         static constexpr bool value =                                         \ | ||||
|                 std::is_integral<decltype(detect(std::declval<T>()))>::value; \ | ||||
|     } | ||||
|  | @ -471,14 +469,12 @@ struct is_compatible_integer_type | |||
| template<typename BasicJsonType, typename T> | ||||
| struct has_from_json | ||||
| { | ||||
|   private: | ||||
|     // also check the return type of from_json
 | ||||
|     template<typename U, typename = enable_if_t<std::is_same<void, decltype(uncvref_t<U>::from_json( | ||||
|                  std::declval<BasicJsonType>(), std::declval<T&>()))>::value>> | ||||
|     static int detect(U&&); | ||||
|     static void detect(...); | ||||
| 
 | ||||
|   public: | ||||
|     static constexpr bool value = std::is_integral<decltype( | ||||
|                                       detect(std::declval<typename BasicJsonType::template json_serializer<T, void>>()))>::value; | ||||
| }; | ||||
|  | @ -488,7 +484,6 @@ struct has_from_json | |||
| template<typename BasicJsonType, typename T> | ||||
| struct has_non_default_from_json | ||||
| { | ||||
|   private: | ||||
|     template < | ||||
|         typename U, | ||||
|         typename = enable_if_t<std::is_same< | ||||
|  | @ -496,7 +491,6 @@ struct has_non_default_from_json | |||
|     static int detect(U&&); | ||||
|     static void detect(...); | ||||
| 
 | ||||
|   public: | ||||
|     static constexpr bool value = std::is_integral<decltype(detect( | ||||
|                                       std::declval<typename BasicJsonType::template json_serializer<T, void>>()))>::value; | ||||
| }; | ||||
|  | @ -505,13 +499,11 @@ struct has_non_default_from_json | |||
| template<typename BasicJsonType, typename T> | ||||
| struct has_to_json | ||||
| { | ||||
|   private: | ||||
|     template<typename U, typename = decltype(uncvref_t<U>::to_json( | ||||
|                  std::declval<BasicJsonType&>(), std::declval<T>()))> | ||||
|     static int detect(U&&); | ||||
|     static void detect(...); | ||||
| 
 | ||||
|   public: | ||||
|     static constexpr bool value = std::is_integral<decltype(detect( | ||||
|                                       std::declval<typename BasicJsonType::template json_serializer<T, void>>()))>::value; | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue