Bug 2918

Summary: Rename Rectangle class to silent Visual Studio errors
Product: ns-3 Reporter: sebastien.deronne
Component: mobility modelsAssignee: sebastien.deronne
Status: PATCH PENDING ---    
Severity: normal CC: tomh
Priority: P3    
Version: ns-3.28   
Hardware: All   
OS: Windows   
Attachments: Patch to rename Rectangle class to Rectangle2d

Description sebastien.deronne 2018-05-16 16:26:54 EDT
Rectangle is the name of a GUI object in Windows.  All of the GUI objects in Windows are accessible from C programs so they don't exist in a namespace. To fix this, a clean solution would be to rename our Rectangle class.

I am now asking for a popular name. Please shout!

My proposal: 2dRectangle or Rectangle2d.
Comment 1 sebastien.deronne 2018-05-17 05:52:08 EDT
Created attachment 3096 [details]
Patch to rename Rectangle class to Rectangle2d

I made a patch based on my name proposal (Rectangle2d).
Comment 2 Tom Henderson 2018-05-17 09:23:17 EDT
(In reply to sebastien.deronne from comment #0)
> Rectangle is the name of a GUI object in Windows.  All of the GUI objects in
> Windows are accessible from C programs so they don't exist in a namespace.
> To fix this, a clean solution would be to rename our Rectangle class.
> 
> I am now asking for a popular name. Please shout!
> 
> My proposal: 2dRectangle or Rectangle2d.

Before we give up so easily on this, is it really the case that this name does not exist in a namespace?  According to this documentation, Rectangle is in a separate namespace.

https://msdn.microsoft.com/en-us/library/system.drawing

Is it possible that the configuration pulls in this namespace unnecessarily?  Is there a 'using System.Drawing;' somewhere?

If I am wrong about this, can someone point me to the full list of reserved names/keywords for Visual Studio?  These are the only lists I found:

https://msdn.microsoft.com/en-us/library/2e6a4at9.aspx
https://docs.microsoft.com/en-gb/cpp/build/reference/reserved-words
Comment 3 sebastien.deronne 2018-05-17 14:28:06 EDT
I cannot help on this, I assumed Robert already made different attempts to fix.