Feature Request

Jul 1, 2015 at 4:31 PM
Edited Jul 1, 2015 at 6:36 PM
Please add support for:
  • PreProcessor from LLVM, GCC etc.
  • Static linking
  • Inlining support
  • C/CPP interop support
  • Ability to disable the GC
  • Global objects, functions, methods etc. like in C/CPP
But so far so good!

Writting every method as a part of a class is really annoying sometime.

As for generics this could also be done by converting it to a C++ template.

void Swap<T>(ref T left, ref T right) {
T temp;
temp = left;
left = right;
right = temp;
}

Since it is converted in to C++ I don't see a reason why it couldn't work.
Coordinator
Jul 1, 2015 at 8:50 PM
Thank you very much for your sugesstions:
PreProcessor from LLVM, GCC etc.
Static linking
Could explain what you need in first 2 items?
Inlining support
It can be added.
C/CPP interop support
Open CoreLib for examplle class DateTime and have a look at property Now
Ability to disable the GC
You need to use switch on command line /gc-
Global objects, functions, methods etc. like in C/CPP
You can use static and use class name as namespace
As for generics this could also be done by converting it to a C++ template.
There is a big problem with C++ templates, it does not support virtual methods on class,

for example in C# it is very simple to write something like this:
class Test
{
      public virtual T Get<T>()
      {
           return default(T);
      }
}
corresponding code in C++ with template could not be compiled. Additionally it is causing issue with using -> and . for value and class types
class Test
{
public:
        template < typename T >
    virtual T Get()
    {
       T t;
       return t;
    }
}
Jul 1, 2015 at 9:16 PM
Well by preprocessor I mean #define SUM(A, B) A +B

By static linking I mean #pragma comment(lib, "ws2_32.lib") for example.

I think GCC has similar thing.

For inlining you could add forceinline and inline keywords :)
Coordinator
Jul 2, 2015 at 9:20 AM
For inlining you could add forceinline and inline keywords :)
It will be done by using attribute on a method as I do not want to extend the specifications of C#