Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2006-01-30 15:11:49


Andy Little wrote:
>Sorry.. that example was completely unnecessary.
>
>I dont see whats wrong with just writing
>
> template< int n >
>int strlen( const fixed_string< n, char >& str )
>{
> return str.length();
>}
>
>Whats wrong with it?

Nothing... in that case. Now, what happened if you have:

template< int n >
void make_ip_address( unsigned long ip, fixed_string< n, char > & )

but you wanted to put this function in a library or DLL either to hide a
proprietry implementation or because the implementation of this is too long
to sensibly be a template (or even both).

I was just giving a simple example of functionality that some people want. I
wasn't saying that was the best way to implement strlen.

- Reece


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