From: SourceForge.net <no...@so...> - 2003-08-06 11:55:48
|
Patches item #784120, was opened at 2003-08-06 11:40 Message generated for change (Comment added) made by redi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=307869&aid=784120&group_id=7869 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jonathan Wakely (redi) Assigned to: Nobody/Anonymous (nobody) Summary: Iterator typedef problems Initial Comment: The definition of class subscript_iterator (in mysqlcppapi/const_subscript_container.h) has a couple of problems. I think the template parameters given to subscript_iterator's base class are wrong. The third param is the iterator's difference_type, which must be a signed type. The parameter given is "typename OnType::size_type", which is an unsigned type. This doesn't actually cause any problems, because difference_type is re-declared correctly later in the subscript_iterator body. The second problem is simply that subscript_iterator inherits from std::iterator. This struct isn't available in the C++ library supplied with GCC 2.95, which prevents that compiler being used. The workaround is to remove the inheritance relationship and declare the iterator_category, value_type, point, reference and difference_type explicily (all std::iterator does is declare these typedefs anyway). This is standard-conforming and loses nothing, but adds backward-compatibility. This patch removes the inheritance and explicitly declares the required typedefs, so that gcc 2.95 can be used to compile the library. ---------------------------------------------------------------------- >Comment By: Jonathan Wakely (redi) Date: 2003-08-06 11:55 Message: Logged In: YES user_id=426241 This latest patch is for the ChangeLog, it should be apprpriate for either patch, although if the first is applied the ChangeLog could mention it was done for GCC 2.95 compatibility. ---------------------------------------------------------------------- Comment By: Jonathan Wakely (redi) Date: 2003-08-06 11:49 Message: Logged In: YES user_id=426241 This second patch is intended for use if backward-compatibility is not desired. Instead of removing the inheritance from std::iterator it fixes the difference_type parameter and removes the unnecessary type_base typedef, re-definition of difference_type, and call to type_base::operator=. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=307869&aid=784120&group_id=7869 |