Jean-Fran?ois Adam wrote:
> thanks for the reply. I haven't use c++ for a long time (and i
> realize i've lost a lot of it!).
Before C++ was standardised 'new' did return NULL, but it was changed
when exceptions were added to the language.
> If it's not null and ApacheRequestRec has no virtual function,
> I think it would be more natural to have the function call to pass a
> reference of pRequest.
N.B. it makes no differencee whether ApacheRequestRec has virtual
functions, passing by reference still allows the class to behave
polymorphically.
I agree, in principle. I have a few changes I would like to propose to
mod_cplusplus, but I wasn't going to suggest this, since it would be an
API change and would break existing code. I prefer to use pointers
rather than references when you might want to pass NULL, but since that
doesn't apply here I see no reason to prefer a pointer to a reference
(except for backward-compatibility).
jon
--
"The future is here. It's just not evenly distributed yet."
- William Gibson
|