Int i(0);

int i(0);

int i{0};

int i = 0;

int i = (0);

int i = {0};

int i([]() {return 0;}());

int i = ([]()-> int {return 0;})();

int i = ([]()-> int {return 0;}());

int i = std::invoke([]()-> int {return 0;});

choose your fighter

Attached: 4f43946-1.jpg (850x565, 70K)

i = 0

:^)

In modern c++ it is best practice to always use the last form using invoke. This gives the compiler the chance to optimize away lvalues so that additional vtables are not created and the variable is stored in the data segment of the application.

int i;
...
i=0;

type My_Integer is new Integer;
I : My_Integer := 0;

>int i = std::invoke([]()-> int {return 0;});
what the fuck am I reading

the absolute fucking state

Or just use auto

>>int i = std::invoke([]()-> int {return 0;});
>[]()-> int {return 0;}
Lambda function that captures nothing, takes no parameters and returns 0. The ->int specifies the return value, but it largely syntactic sugar here.

>std::invoke();
Allows you to call things that satisfy the Callable attribute. This is TMP and functional programming shenanigans. In most cases you're not going to need or want to call things this way.

int i = (int)"\0\0\0";

[int]$i = 0

C doesn't have this problem

>But what if... I were to use a string and disguise it as my own integer?
> Hohoho... Delightfully devilish, Bjarne.

What do you mean?

Integer i = new Integer(0);

Doesn't matter in most cases. I'd go for quick readability- int i = 0;
I think some languages do it one better with i = 0, but I don't want diabetes so fuck that.

C++ sure is flexible

but that would make my code actually legible

Kinda bloated as well, from another point of view. Many feet have been lost.

int i = (((0)));

var i = 0;

return rand();

> Golang

i := 0