Quantcast
Channel: Bartek's coding blog
Viewing all articles
Browse latest Browse all 325

C++ Tricks: IIFE for Complex Variable Initialization

$
0
0

IIFE for complex initialization of const variables in C++

What do you do when the code for a variable initialization is complicated? Do you move it to another method or write inside the current scope?

In this blog post, I’d like to present a trick that allows computing a value for a variable, even a const variable, with a compact notation.

Read more...

Viewing all articles
Browse latest Browse all 325

Trending Articles