[fdo-users] ArcSDE: Another serious bug (general C++ trap)
Greg Boone
greg.boone at autodesk.com
Mon Feb 28 10:26:57 EST 2011
This looks like a good area for refactoring. I agree that having the default constructor call the non-default constructor is not the best approach.
Greg
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Oyvind Idland
Sent: Monday, February 28, 2011 7:41 AM
To: FDO Users Mail List
Subject: [fdo-users] ArcSDE: Another serious bug (general C++ trap)
In the definition of ArcSDEFilterToSql (in ArcSDEFilterToSQL.h), there are two
constructors:
ArcSDEFilterToSql() { ArcSDEFilterToSql(NULL, NULL); } // 0-argument constructor to please FdoPtr::operator->
ArcSDEFilterToSql (ArcSDEConnection *conn, FdoClassDefinition* definition);
The first one with no arguments will not work, in fact, it will just allocate another instance of itself and return.
There is, as far as I know, no way to make a constructor call another constructor in C++. Instead, an init() method
must be implemented.
I don't know if this constructor has ever been used, I just saw it while refactoring code.. but I am a bit worried if
this has been done several places.
-- Oyvind
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20110228/5950cb48/attachment.html
More information about the fdo-users
mailing list