
30 Jan
2006
30 Jan
'06
8:11 p.m.
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