… | |
… | |
345 | MTH void refcnt_dec () const { --refcnt; } |
345 | MTH void refcnt_dec () const { --refcnt; } |
346 | |
346 | |
347 | refcnt_base () : refcnt (0) { } |
347 | refcnt_base () : refcnt (0) { } |
348 | }; |
348 | }; |
349 | |
349 | |
|
|
350 | // to avoid branches with more advanced compilers |
350 | extern refcnt_base::refcnt_t refcnt_dummy; |
351 | extern refcnt_base::refcnt_t refcnt_dummy; |
351 | |
352 | |
352 | template<class T> |
353 | template<class T> |
353 | struct refptr |
354 | struct refptr |
354 | { |
355 | { |
… | |
… | |
544 | // return current time as timestampe |
545 | // return current time as timestampe |
545 | tstamp now (); |
546 | tstamp now (); |
546 | |
547 | |
547 | int similar_direction (int a, int b); |
548 | int similar_direction (int a, int b); |
548 | |
549 | |
549 | // like printf, but returns a std::string |
550 | // like sprintf, but returns a "static" buffer |
550 | const std::string format (const char *format, ...); |
551 | const char *format (const char *format, ...); |
551 | |
552 | |
552 | #endif |
553 | #endif |
553 | |
554 | |