Changeset d03a386 for libcfa/src
- Timestamp:
- Apr 11, 2025, 1:23:39 AM (5 months ago)
- Branches:
- master
- Children:
- dab6e39
- Parents:
- 570e7ad
- Location:
- libcfa/src/collections
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string.cfa
r570e7ad rd03a386 14 14 // 15 15 16 #define _COMPILING_STRING_CFA_ 17 16 18 #include "string.hfa" 17 19 #include "string_res.hfa" … … 40 42 } 41 43 42 void ?{}( string & s, string c ) { // c is a memcpy of the real src string44 PBOOST void ?{}( string & s, string c ) { // c is a memcpy of the real src string 43 45 (s.inner) { malloc() }; 44 46 ?{}( *s.inner, *c.inner, COPY_VALUE ); … … 146 148 // Assignment 147 149 148 string & ?=?( string & s, string c ) {150 PBOOST string & ?=?( string & s, string c ) { 149 151 (*s.inner) = (*c.inner); 150 152 return s; … … 326 328 } 327 329 328 string ?+?( string s, string s2 ) {330 PBOOST string ?+?( string s, string s2 ) { 329 331 string ret = s; 330 332 ret += s2; … … 375 377 } 376 378 377 string ?*?( string s, strmul_factor_t factor ) {379 PBOOST string ?*?( string s, strmul_factor_t factor ) { 378 380 string ret = s; 379 381 ret *= factor; -
libcfa/src/collections/string.hfa
r570e7ad rd03a386 19 19 #include <string_res.hfa> 20 20 21 static struct __cfa_string_preference_boost_t {} __cfa_string_preference_boost; 22 #define PBOOST forall ( | { __cfa_string_preference_boost_t __cfa_string_preference_boost; } ) 23 21 24 struct string { 22 25 string_res * inner; … … 28 31 void ?{}( string & s ); // empty string 29 32 void ?{}( string & s, string s2, size_t maxlen ); 30 void ?{}( string & s, string s2 );33 PBOOST void ?{}( string & s, string s2 ); 31 34 void ?{}( string & s, char ); 32 35 void ?{}( string & s, const char * c ); // copy from string literal (NULL-terminated) … … 48 51 // string str( long double _Complex rhs ); 49 52 50 string & ?=?( string & s, string c );53 PBOOST string & ?=?( string & s, string c ); 51 54 string & ?=?( string & s, const char * c ); // copy from "literal" 52 55 string & ?=?( string & s, char c ); // copy from 'l' … … 162 165 string ?+?( string s, char c ); 163 166 string ?+?( char c, string s ); 164 string ?+?( string s, string s2 );167 PBOOST string ?+?( string s, string s2 ); 165 168 string ?+?( const char * s, char c ); // not backwards compatible 166 169 string ?+?( char c, const char * s ); … … 184 187 void ?*=?( string & s, strmul_factor_t factor ); 185 188 string ?*?( char c, strmul_factor_t factor ); // not backwards compatible 186 string ?*?( string s, strmul_factor_t factor );189 PBOOST string ?*?( string s, strmul_factor_t factor ); 187 190 string ?*?( const char * s, strmul_factor_t factor ); 188 191 static inline string ?*?( strmul_factor_t factor, char s ) { return s * factor; } 189 static inline string ?*?( strmul_factor_t factor, string s ) { return s * factor; }192 PBOOST static inline string ?*?( strmul_factor_t factor, string s ) { return s * factor; } 190 193 static inline string ?*?( strmul_factor_t factor, const char * s ) { return s * factor; } 191 194 … … 314 317 return translate( S, f ); 315 318 } 319 320 #ifndef _COMPILING_STRING_CFA_ 321 #undef PBOOST 322 #endif
Note:
See TracChangeset
for help on using the changeset viewer.