|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2006-01-30 16:50:47
"Reece Dunn" wrote
Andy Little wrote
>>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).
Sure dont make it a template . OTOH BTW Why would you want to choose
fixed_string for this application?. String manipulation time will be dwarfed by
look up time anyway.
> 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.
I think you might find the non template version starts to look quite like a
(maybe improved) version of std::string. Fact is once the capacity is changeable
theres no reason not to provide the whole interface. OTOH maybe you are trying
to make an alternative to std::string, if so then you need to show demostrable
benefits, but then I hope it wouldnt be called fixed_string !
regards
Andy Little
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk