Posts Tagged function

C++ For C# Developers: Part 17 – Namespaces

Tags: , , , ,

With structs wrapped up, we can move on to other features of C++. Today we’ll take a look at namespaces. We’ll cover the basics that C# provides, but go so much further and cover a lot of advanced functionality. Read on to learn all about them!

Read the rest of this article »

1 Comment

C++ For C# Developers: Part 16 – Struct and Class Wrapup

Tags: , , , , ,

Today we’ll wrap up structs and classes by discussing a bunch of miscellaneous features: local classes, unions, overloaded assignment operators, and user-defined literals. C# doesn’t have any of these features, but it can emulate some of them. Read on to learn a bunch of new tricks!

Read the rest of this article »

No Comments

C++ For C# Developers: Part 8 – References

Tags: , , , ,

The series continues today by picking up where we left off with pointers. We’ll discuss a popularly-used alternative in C++: references. These are quite different from the various concepts of references in C#!

Read the rest of this article »

3 Comments

C++ For C# Developers: Part 7 – Pointers, Arrays, and Strings

Tags: , , ,

Today we’ll continue the series with a look into pointers and, very differently from C#, the related concepts of arrays and strings. We’ll cover some interesting C++-only features, such as function pointers along the way.

Read the rest of this article »

2 Comments

C++ For C# Developers: Part 4 – Functions

Tags: , , , , ,

The series continues today with functions. These are obviously core to any programming language, but it’s not obvious how many ways they differ from functions in C#. From compile-time execution to automatic return value types, there are a lot of differences to cover today.

Read the rest of this article »

2 Comments

Generic Algorithm Examples

Tags: , ,

There are many common algorithms that we use constantly: searching, filtering, mapping, and so forth. Today we’ll write a few in the Burst-friendly way as examples of how to write Burst-friendly code that’s still reusable and efficient.

Read the rest of this article »

4 Comments

Function Types: A Spectrum

Tags: , , , ,

C# gives us lots of types of functions for us to call. We must constantly decide between them. Should this function be static? Should it be virtual? There are many factors that go into making the decision. Today we’ll look at the function types as a spectrum and hopefully get a little perspective on our options.

Read the rest of this article »

5 Comments

Burst Function Pointers vs. Jobs

Tags: , , ,

Function pointers aren’t the only way to express a unit of work. Unity’s own job system does just this, albeit in a different way. Today we’ll compare the performance of Burst’s function pointers against jobs themselves!

Read the rest of this article »

3 Comments

Burst Function Pointers vs. Switch Statements

Tags: , , ,

A couple weeks ago we took a look at the performance of function pointers in Burst. In doing so, we left out an alternative: good old switch statements. Today we’ll put those to the test to see how they stack up next to Burst’s newfangled function pointers!

Read the rest of this article »

3 Comments

DIY Virtual Functions in Burst

Tags: , , , , ,

Now that we’ve seen how function pointers work and perform in Burst, let’s use them to build a higher-level feature: virtual functions!

Read the rest of this article »

2 Comments