inline variables (C++ 17 and beyond) | Modern Cpp Series Ep. 110

  Рет қаралды 6,062

Mike Shah

Mike Shah

Күн бұрын

Пікірлер
@chillrelax5056
@chillrelax5056 Жыл бұрын
Your videos are like masala chai! Refreshing and insightful!
@MikeShah
@MikeShah Жыл бұрын
Hehe cheers!
@sanjaygatne1424
@sanjaygatne1424 Жыл бұрын
your videos are just awesome. makes the stuff easy to understand.
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@qcnck2776
@qcnck2776 Жыл бұрын
Thanks. Looking forward to more C++ vids
@MikeShah
@MikeShah Жыл бұрын
Cheers, more coming!
@monty6393
@monty6393 Жыл бұрын
Thanks mike for the video..
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@bffever8803
@bffever8803 Жыл бұрын
your video is amazing ,i love it
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@nicksklenicka8926
@nicksklenicka8926 Жыл бұрын
Much appreciated.
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@Byynx
@Byynx Жыл бұрын
Hi can you explain why we can declare the var "static int SomeValue" and then write "int Struct::SomeValue=63" with the same syntax as if we were creating a variable? And is it because the compiler knows "SomeValue" var has to be initialized that the linker trys to find that initialilization in each source file and that's why it executes the line "int Struct::SomeValue=63" from "Struct.cpp" file?
@MikeShah
@MikeShah Жыл бұрын
Struct::SomeValue is part of the scope (Struct:: that is). For static variables, you typically declare in the implementation (.cpp file) the value to build the symbol.
@RobBCactive
@RobBCactive Жыл бұрын
This could have been clearer, an example the main.c variable Struct s isn't apparently used and struct Struct with one member, is not concretely useful. Fundamentally the hpp file attempts to both declare the type and an instance of it, allocating static memory, while consts are replicatable compile time values so implicitly non-extern non global (not lvalues). When Struct.cpp was used static is meaninglessly contradictory as it wasn't in a function scope and it wasn't a file variable. How on earth is this cleaner? It just looks like hacking an erroneous data concept until it compiles. A hint is the compiler error message reminding that it considers Struct a class.
Introduction to constexpr | Modern Cpp Series Ep. 86
10:56
Mike Shah
Рет қаралды 12 М.
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 831 М.
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 58 М.
Global Variables in C++... not as easy as it seems
18:25
The Cherno
Рет қаралды 66 М.
Software Development with C++: Inline Variables
9:42
Nick
Рет қаралды 1,3 М.
Что делать если разрядился iPad
0:53
Mikha Zen
Рет қаралды 577 М.
WOW 😱 How to Make AirPods from Regular Headphones
0:47
ALABAYCHIC
Рет қаралды 14 МЛН
Nokia now vs Then 💀🗿 #blowup #nokia #edit #foryou
0:31
skullmaxx
Рет қаралды 22 МЛН
СДЕЛАЙ ТАК . Пульт будет работать вечно
9:39
Мужские интересы 79
Рет қаралды 402 М.