Re: [Modcplusplus-devel] (johnksterling) mod_cplusplus/src cpp_request.cpp
Brought to you by:
gr84b8,
johnksterling
From: Jonathan W. <co...@co...> - 2004-08-05 09:59:09
|
On Wed, Aug 04, 2004 at 03:33:21PM +0100, Jonathan Wakely wrote: > Hi again, > > Looking at that commit again, I'm not sure the const-correctness fixes > are right. > e.g. > - char *the_request() { return mRequest->the_request; } > + char *the_request() const { return mRequest->the_request; } > > This allows the following to compile, but the assertion will fail: > > void f(ApacheRequestRec const& r) // N.B. const > { > const std::string the_orig_request( r.the_request() ); > > r.the_request()[0] = '\0'; > > assert( the_request == r.the_request() ); // ^^^^^^^^^^^ this should be: assert( the_orig_request == r.the_request() ); // ^^^^^^^^^^^^^^^^ > } Sorry for any confusion. jon -- "Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians." - Edsger Dijkstra |