Posts Tagged constant

C++ For C# Developers: Part 26 – Template Parameters

Tags: , , ,

Last time, we started looking at a core feature of C++: templates. We compared and contrasted them to C# generics and saw how they’re applied to classes, functions, lambdas, and even variables. Today we’ll leverage the power of so-called “non-type template parameters” and “template template parameters” to write some really interesting code.

Read the rest of this article »

2 Comments

The Const Keyword

Tags: , , , , , ,

Amazingly, I’ve never covered the const keyword, but a couple of recent comments have prompted me to cover the subject in depth with today’s article.

Read the rest of this article »

12 Comments

Compile-Time Constants

Tags: , ,

Alec McEachran’s latest article about constants reminded me of a trick I’ve recently learned and became a big fan of. His article expresses the pain endured by those who wish for both speed and maintainability in their AS3 apps. The solution the article doesn’t reach though is that of compile-time constants. This is truly the best of both worlds, so let’s learn about it.

Read the rest of this article »

11 Comments