Diff for /parser3/src/include/pa_array.h between versions 1.105 and 1.106

version 1.105, 2025/08/01 16:14:44 version 1.106, 2026/01/06 13:07:58
Line 14 Line 14
   
 #include "pa_memory.h"  #include "pa_memory.h"
 #include "pa_types.h"  #include "pa_types.h"
   #include "pa_int.h"
 #include "pa_exception.h"  #include "pa_exception.h"
   
 // forwards  // forwards
Line 246  private: //disabled Line 247  private: //disabled
 };  };
   
   
 /// Commonly used, templated to work with any integer type  
   
 template<typename T> char* pa_itoa(T n, T base=10){  
         char buf[MAX_NUMBER + 1];  
         char* pos=buf + MAX_NUMBER;  
         *pos='\0';  
   
         bool negative=n < 0;  
         if (n < 0){  
                 n=-n;  
         }  
   
         do {  
                 *(--pos)=(char)(n % base) + '0';  
                 n/=base;  
         } while (n > 0);  
   
         if (negative) {  
                 *(--pos) = '-';  
         }  
         return pa_strdup(pos, buf + MAX_NUMBER - pos);  
 }  
   
 template<typename T> char* pa_uitoa(T n, T base=10){  
         char buf[MAX_NUMBER + 1];  
         char* pos=buf + MAX_NUMBER;  
         *pos='\0';  
   
         do {  
                 *(--pos)=(char)(n % base) + '0';  
                 n/=base;  
         } while (n > 0);  
   
         return pa_strdup(pos, buf + MAX_NUMBER - pos);  
 }  
   
   
 /** Array iterator, usage:  /** Array iterator, usage:
         @code          @code
         // Array<T> a;          // Array<T> a;

Removed from v.1.105  
changed lines
  Added in v.1.106


E-mail: