[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r24557 - trunk/subversion/bindings/javahl/native

From: Blair Zajac <blair_at_orcaware.com>
Date: 2007-04-12 18:18:50 CEST

hwright@tigris.org wrote:
> Author: hwright
> Date: Thu Apr 12 09:02:49 2007
> New Revision: 24557
>
> Log:
> JavaHL: Add implicit type conversion to the C++ Path class, allowing
> objects of this class to be directly used wherever a const char * is
> expected.
>
> Suggested by: dlr

I don't think this is such a good idea. There's too much magic going on
here :)

Is the point here just to save some typing?

I would rather have the conversion be explicit. The c_str() method also
makes it clear on the ownership of the memory. For somebody who isn't
too familiar with the JavaHL bindings, I would much rather see c_str()
in the code and immediately know the ownership issues than wonder what's
going on. Also, with this change, there's no documentation on who owns
the memory after the implicit conversion, one has to check the code.

Also, note that the C++ standard committee deliberately didn't choose to
have this conversion for std::string, I don't think we should use it for
Path either.

Regards,
Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 12 18:19:31 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.