Boost logo

Boost :

From: Tanton Gibbs (thgibbs_at_[hidden])
Date: 2002-11-20 17:31:01


> > 1. Just document it. Not so good, IMHO.
> >
> > 2. Document the special case and add a check for NULL pointers before
> > calling strcmp().
> >
> > 3. Remove the special case alltogether. After all, I might want to check
> > that the pointers are equal and not the string they point to. This might
> > be the best solution, but breaks backward compatibility.
> >
> > Markus
>
> In majority of the cases when user is comparing two character pointers he
> need namely "string comparison". Requiring to cast both sides to
std::string
> is a big burden IMO. So I would choose solution 2.
>
> Gennadiy.

I agree with this. I know people will occasionally want to check whether
two char* ptrs are pointing to the same value, but it doesn't seem to me to
be as common as checking whether two char* are "strcmp" equal. To get ptr
equality, the users could just cast the char* to void*.

Tanton


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