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 #22948 is a reply to message #22908] |
Wed, 02 September 2009 04: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
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
[Updated on: Wed, 02 September 2009 04:49] Report message to a moderator
|
|
|
|
|
Strange behavior of Point in watches
|
|
|
Re: Strange behavior of Point in watches
By: mirek on Tue, 25 August 2009 10:07
|
|
|
Re: Strange behavior of Point in watches
|
|
|
Re: Strange behavior of Point in watches
By: mirek on Wed, 26 August 2009 09:00
|
|
|
Re: Strange behavior of Point in watches
|
|
|
Re: Strange behavior of Point in watches
By: dolik.rce on Wed, 02 September 2009 04:47
|
|
|
Re: Strange behavior of Point in watches
By: mirek on Wed, 02 September 2009 17:59
|
|
|
Re: Strange behavior of Point in watches
By: dolik.rce on Wed, 02 September 2009 19:17
|
|
|
Re: Strange behavior of Point in watches
By: mirek on Wed, 02 September 2009 20:43
|
|
|
Re: Strange behavior of Point in watches
By: dolik.rce on Thu, 03 September 2009 10:19
|
|
|
Re: Strange behavior of Point in watches
By: mr_ped on Thu, 03 September 2009 11:11
|
|
|
Re: Strange behavior of Point in watches
By: dolik.rce on Thu, 03 September 2009 19:00
|
|
|
Re: Strange behavior of Point in watches
By: mr_ped on Fri, 04 September 2009 08:32
|
Goto Forum:
Current Time: Tue May 21 15:35:05 CEST 2024
Total time taken to generate the page: 0.03725 seconds
|