Comments for Late Developer https://latedev.wordpress.com Random thoughts of an old C++ guy Sun, 17 Nov 2013 21:46:19 +0000 hourly 1 http://wordpress.com/ Comment on Less Than Obvious by milton https://latedev.wordpress.com/2013/08/12/less-than-obvious/#comment-377 Sun, 17 Nov 2013 21:46:19 +0000 http://latedev.wordpress.com/?p=678#comment-377 This is an interesting post. It helped me understand that, from the point of view of std::set (and others), if a is not < b, and b is not < a, then a and b are equivalent.

However your initial operator<() in the Point example does enforce Strict Weak Ordering, as it satisfies all of the properties thereof:

– ∀x it is not the case that x < x (irreflexivity)
– ∀x,y if x < y then it is not the case that y < x (asymmetry)
– ∀x,y,z if x < y and y < z then x < z (transitivity)
– ∀x,y,z if x is incomparable with y, and y is incomparable with z, then x is incomparable with z (transitivity of incomparability, although all Points are comparable)

The issue is with the equivalence classes that it creates in the set of Points: any 2 Points a and b are equivalent if a – b (or b – a) falls on quadrant II, quadrant IV, or a primary axis.

Thanks for the post, it helps make this subtle bug a little less less-than-obvious.

]]>
Comment on C++ Debug Macros by Neil Butterworth https://latedev.wordpress.com/2012/08/09/c-debug-macros/#comment-162 Fri, 07 Sep 2012 15:04:59 +0000 http://latedev.wordpress.com/?p=577#comment-162 In reply to Anton Golov (@jesyspa).

Yes, but in real life I never seem to have those errors, so I never bother.

]]>
Comment on C++ Debug Macros by Anton Golov (@jesyspa) https://latedev.wordpress.com/2012/08/09/c-debug-macros/#comment-161 Fri, 07 Sep 2012 14:22:12 +0000 http://latedev.wordpress.com/?p=577#comment-161 Would wrapping your macros in a do { } while(false) not remove some potential for errors?

]]>
Comment on How to install a C++ compiler on Windows by Neil Butterworth https://latedev.wordpress.com/2011/06/20/how-to-install-a-c-compiler-on-windows/#comment-118 Thu, 29 Mar 2012 20:44:11 +0000 http://latedev.wordpress.com/?p=29#comment-118 In reply to Danish.

> Can you please help in how to update the exisiting MinGW of code::blocks with this TDM MinGW32 rather then setting it up at a different place and then keeping the useless old one too?

Well, the old one may not be useless. But if you want to replace it, simply delete the root MinGW directory and install the TDM version in the same place.

]]>
Comment on How to install a C++ compiler on Windows by Danish https://latedev.wordpress.com/2011/06/20/how-to-install-a-c-compiler-on-windows/#comment-117 Wed, 28 Mar 2012 20:33:49 +0000 http://latedev.wordpress.com/?p=29#comment-117 Can you please help in how to update the exisiting MinGW of code::blocks with this TDM MinGW32 rather then setting it up at a different place and then keeping the useless old one too?

]]>
Comment on How to install a C++ compiler on Windows by Sam https://latedev.wordpress.com/2011/06/20/how-to-install-a-c-compiler-on-windows/#comment-113 Wed, 29 Feb 2012 09:26:43 +0000 http://latedev.wordpress.com/?p=29#comment-113 Thank you! I have been struggling with this all morning but have now managed to install a C ++ compiler with your instruction, hurrah!

]]>
Comment on Writing a Real C++ Program – Part 3 by Joshua https://latedev.wordpress.com/2011/08/02/writing-a-real-c-program-part-3/#comment-110 Mon, 20 Feb 2012 17:13:48 +0000 http://latedev.wordpress.com/2011/08/02/writing-a-real-c-program-part-3/#comment-110 This tutorial is amazing! The pedagogy and content are both superb. Thank you for providing this.

BTW: I arrived here from r/learnprogramming. This tutorial and the one about stringstreams are the most useful things since opposable thumbs.

]]>
Comment on Simple Input Bullet-Proofing In C++ by Neil Butterworth https://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-104 Sun, 22 Jan 2012 15:24:07 +0000 http://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-104 In reply to Jehjoa.

Those seem to be identical names to me. I think you must have mistyped something.

]]>
Comment on Simple Input Bullet-Proofing In C++ by Jehjoa https://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-103 Sun, 22 Jan 2012 14:50:49 +0000 http://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-103 In the template function you use numeric_limits::max(), shouldn’t that now be numeric_limits::max()?

]]>
Comment on Simple Input Bullet-Proofing In C++ by PB https://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-102 Sat, 21 Jan 2012 20:37:29 +0000 http://latedev.wordpress.com/2011/09/13/simple-input-bullet-proofing-in-c/#comment-102 The first argument to ignore gets converted to a streamsize, which is only guaranteed to be one of the basic integer types and might not have the same numeric limits as int. So the call to ignore might not always empty the line.

]]>