1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_IOS_NS_RANGE_H_ 6 #define BASE_IOS_NS_RANGE_H_ 7 8 #import <Foundation/Foundation.h> 9 10 // Returns whether the two NSRange are equal. 11 inline bool operator==(NSRange lhs, NSRange rhs) { 12 return lhs.location == rhs.location && lhs.length == rhs.length; 13 } 14 15 // Returns whether the two NSRange are not equal. 16 inline bool operator!=(NSRange lhs, NSRange rhs) { 17 return lhs.location != rhs.location || lhs.length != rhs.length; 18 } 19 20 #endif // BASE_IOS_NS_RANGE_H_ 21