[sword-svn] r3759 - trunk/include

scribe at crosswire.org scribe at crosswire.org
Sat Jul 25 02:15:10 EDT 2020


Author: scribe
Date: 2020-07-25 02:15:10 -0400 (Sat, 25 Jul 2020)
New Revision: 3759

Modified:
   trunk/include/swbuf.h
Log:
added const version of SWBuf::charAt


Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2020-07-25 03:51:17 UTC (rev 3758)
+++ trunk/include/swbuf.h	2020-07-25 06:15:10 UTC (rev 3759)
@@ -163,6 +163,7 @@
 // unguarded impl. This is obviously much faster and is likely why std::string specifies references out of bounds have undefined
 // behavior.  This is the default impl for operator []
 	inline char &charAt(unsigned long pos) { return *(buf + pos); }
+	inline const char &charAt(unsigned long pos) const { return *(buf + pos); }
 
 /* these have all proven to be slower implementations */
 //	inline char &charAt(unsigned long pos) { return buf[pos]; }



More information about the sword-cvs mailing list