Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Strange behavior of Point in watches
Re: Strange behavior of Point in watches [message #22957 is a reply to message #22948] Wed, 02 September 2009 17:59 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
dolik.rce wrote on Tue, 01 September 2009 22:47

Helo Mirek!

Sorry it took me so long, but I was busy at work.

I did a little investigation and finally found exact piece of code that causes problems in gdb. I'm not sure what is the real reason, but all the troubles are caused by following constructors:
	Point_(const Point_<int>& pt) : x((T)pt.x), y((T)pt.y) {}
	Point_(const Point_<short>& pt) : x((T)pt.x), y((T)pt.y) {}
	Point_(const Point_<double>& pt) : x((T)pt.x), y((T)pt.y) {}
	Point_(const Point_<int64>& pt) : x((T)pt.x), y((T)pt.y) {}

If you replace those four lines by
	template <class U>
	Point_(const Point_<U>& pt) : x((T)pt.x), y((T)pt.y) {}
watches show correct values. Do you think that this workaround is safe? To my best knowledge it should produce absolutely same results as original code and nobody should try passing there any non-scalar type, so it should not cause any harm... but I'm no expert when it comes to templates Rolling Eyes

Also, during the investigation I found that same problems apply to Size_ and Rect_. Since their anatomy is very similar, it should be possible to apply the same workaround.

Honza


I do not know... I really hate such workarounds for debugger problems...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: tutorial Gui20c's defect
Next Topic: DropList + AddSeparator + mouse wheel problem
Goto Forum:
  


Current Time: Wed May 22 12:32:28 CEST 2024

Total time taken to generate the page: 0.01741 seconds