comparison src/graphics.h.in @ 8023:0ff67bd96f8d

graphics.h.in: replace NPOS with std::string::npos
author John W. Eaton <jwe@octave.org>
date Thu, 07 Aug 2008 15:41:07 -0400
parents 9cd3ee5298a0
children 961d4c52ffae
comparison
equal deleted inserted replaced
8022:9708674ab85d 8023:0ff67bd96f8d
59 } 59 }
60 60
61 operator std::string (void) const { return *this; } 61 operator std::string (void) const { return *this; }
62 62
63 // Case-insensitive comparison. 63 // Case-insensitive comparison.
64 bool compare (const std::string& s, size_t limit = NPOS) const 64 bool compare (const std::string& s, size_t limit = std::string::npos) const
65 { 65 {
66 const_iterator p1 = begin (); 66 const_iterator p1 = begin ();
67 const_iterator p2 = s.begin (); 67 const_iterator p2 = s.begin ();
68 68
69 size_t k = 0; 69 size_t k = 0;
75 75
76 *p1++; 76 *p1++;
77 *p2++; 77 *p2++;
78 } 78 }
79 79
80 return (limit == NPOS) ? size () == s.size () : k == limit; 80 return (limit == std::string::npos) ? size () == s.size () : k == limit;
81 } 81 }
82 }; 82 };
83 83
84 // --------------------------------------------------------------------- 84 // ---------------------------------------------------------------------
85 85