
20 Oct
2004
20 Oct
'04
8:05 p.m.
Rogier van Dalen wrote:
// The actual Unicode string template <class CodeUnits, class NormalisationForm, class ErrorChecking> class string
By using ErrorChecking as a template parameter, you are encoding it as part of the string type, but this is not necessary, because there is no difference between values of strings with different ErrorChecking policies (ErrorChecking does not change the invariant). You should just provide different member functions for the two ErrorChecking behaviors, or pass the ErrorChecking parameter to the member functions that require it. The other two parameters do seem to affect the string value/invariant, so they aren't redundant. Whether they are a good idea is another matter. :-)