Re:On the evolution of programming style: How far C++ has mo...
by marshray on Monday March 26, 2012 @06:45PM
(#3759004)
Thanks for that info. Anyone know if C# has something similar?
From the linked docs: So when should you use static import? Very sparingly!
To me, it sort of confirms the point that these inelegant features are necessary because the language doesn't support fundamental primitives like plain functions and named constants without a superfluous object definition.
Re:On the evolution of programming style: How far C++ has mo...
by pauldino on Tuesday March 27, 2012 @12:44AM
(#3760054)
The CLI itself actually supports unadorned functions, but C# doesn't provide a way of writing them, or using directly them without resorting to reflection. I'm pretty sure C++/CLI lets you use and write standalone functions in managed code, and come to think of it I imagine F# would too. Also it's not an exact equivalent, but C# extension methods can often be used instead of static methods.
http://docs.oracle.com/javase/1.5.0/docs/guide/language/stat...