The Guidelines Support Library is a small collection of utilities for C++. Today we’ll look at how two of them can make our C# code safer and cleaner.
Posts Tagged null
It’s been quite a while in the series since we’ve added any fundamental C# language features. Today we’ll address one of the limitations of the C#/C++ communication: the lack of support for
ref parameters. This is important as they’re commonly used by both the Unity API and .NET and we’d like C++ to be able to call functions with these kinds of parameters. So let’s delve into what it means for C++ to use
ref parameters and see how to implement support for that across the language boundary.
We all use
>= with integers and floating point values all the time. It just works and it’s built into basically every programming language. These simple operators suddenly become quite a pain when you start wanting to compare other objects.
IComparable seems to make it easier, but there’s some trickiness when you start dealing with
null objects. Today’s article explores this and ends up with some handy utility functions to take some of the gotchas out of comparing.