Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-05-28 10:07:53


Rob Stewart wrote:
>From: John Nagle <nagle_at_[hidden]>
> > (And you have to supply conversions.) Most strings are sized a bit too
> > big, anyway.
>
>Oh, it just occurred to me that when the two have the same size,
>there should be a cctor and copy assignment operator to avoid the
>virtual function call overhead.

The cctor also fixes a bug that caused a pure virtual function run-time
error with VC when you have the following:

      template< size_t n, class C, class CSP >
      inline fixed_string< n, C, CSP > runtime_error()
      {
         fixed_string< n, C, CSP > res( "oops!" );
         return( res ); // pure virtual call here
      }

Thanks!

>You might even be able to do
>some metaprogramming to determine whether the capacity of the
>source string is less than or equal to the capacity of the
>destination string and avoid the virtual function call overhead
>for an entire class of copies.

I'll look into this.

Regards,
Reece

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk