Re: Question about std templates

2005-08-08 Thread Jari Sundell
On 8/8/05, stefano luceri <[EMAIL PROTECTED]> wrote:
> hello to all
> 
> anyone know if is possible to add a member to a template of standard
> library?

Have you considered using public or private inheritance from the STL container?

-- 
Rakshasa

Nyaa?


std::string::operator==/!= optimization

2007-07-19 Thread Jari Sundell

Looking at the std::string comparison operators, they all seem to be
using std::string::compare directly even in cases where the string
lengths must match. Comparing the string lengths before the
std::string::compare call in std::string::operator==/!= would avoid
doing a byte-for-byte comparison in most cases where unequal strings
are compared.

A quick glance at the object code shows that the new conditional
replaces the std::min in std::string::compare in addition to reducing
the code size slightly, when compiled with -O2.

Or is there some specific reasons why this isn't done?

Jari Sundell