C# generics (
List<T>) look a lot like C++ templates (
list<T>), but they’re different in many key ways. It’s a big subject, so today we’ll start by looking at some of the most common uses of templates: applying them to classes, functions, members, lambdas, and variables.
Posts Tagged variable
C# generics (
The vast majority of the code we write executes at runtime. Today’s article is about the other kind of code, which runs during compilation. C# has very limited support for this. In C++, especially its newer versions, most of the language features are usable at compile-time. Read on to learn how to take advantage of this!
Many modern strongly-typed languages have introduced a way for you to not have to type a variable’s type. In C#, you can use
var instead of the actual type. In C++, you use
auto. AS3 has a similar feature with it’s “untyped” type:
*. In those other languages,
auto are syntax sugar that the compiler replaces with the actual type. Will the AS3 compiler and/or Flash Player do the same for us? Today’s article finds out if it’s safe to skip the type and just use
describeTypeJSON function is faster than the XML-based
describeType function by default, but we can make it even faster. Today’s article describe just how this is done and achieves a nearly 10x speedup!
Above all others, there is one article I refer back to most: 2009’s Function Performance. It was updated for Flash Player 10.1 and 10.2, but not 10.3, 11.0, 11.1, or 11.2. Today I’m updating this article for Flash Player 11.2, adding some missing function types, and including a set of graphs to make for the ultimate function performance reference.