C++ Weekly - Ep 104 - Learning 'Modern' C++ - 4 : const and constexpr

preview_player
Показать описание
☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟

T-SHIRTS AVAILABLE!

WANT MORE JASON?

SUPPORT THE CHANNEL

GET INVOLVED

JASON'S BOOKS

► C++23 Best Practices

► C++ Best Practices

JASON'S PUZZLE BOOKS

► Object Lifetime Puzzlers Book 1

► Object Lifetime Puzzlers Book 2

► Object Lifetime Puzzlers Book 3

► Copy and Reference Puzzlers Book 1

► Copy and Reference Puzzlers Book 2

► Copy and Reference Puzzlers Book 3

► OpCode Puzzlers Book 1


RECOMMENDED BOOKS

AWESOME PROJECTS

O'Reilly VIDEOS

Source:
Рекомендации по теме
Комментарии
Автор

From the title I was expecting some explanation of constexpr and const.

tonyg
Автор

Title is misleading. You say it's about learning modern c++, yet you just use constexpr assuming everybody already knows what it is and why you use it. lol

brucewayne
Автор

Why exactly is it valid code to declare do_thing() and do_other_thing() as constexpr? ASAIK constexpr indicates, that the compiler should evaluate something during compile time. But data+4 is generally dependent on the 'data' field.

marioschmidt
Автор

What a waste of time. Label your videos correctly, this doesn't explain anything about constexpr

history
Автор

Is `constexpr` the modern `inline`? I.e. if a function is passed arguments known at compile time, why wouldn't it try to run it at compile time without being told to by the person who wrote it?

AndrewHelgeCox
Автор

Sir can you tell me the name about Cppcheck analysis tool?

huyvole
Автор

clang probably wouldn't have complained if sizeof(long) had been replaced with sizeof(void*) which seems to be more correct, depending on what is meant by a 64-bit architecture

akryuk
Автор

Honestly dude your explanation is blank, I understood wut to do but why I should do that was not explained properly. Some good C++ coder would explain everything in details along with wut compiler will do in the background.
I am not here to rote learn I am here to understand.

ShivamSharma
Автор

The very idea of not only allowing but also expecting _automated checking tools_ to _guide_ your programming and to _teach_ you, to me seems horribly, horribly wrong. Disastrously wrong. Against every principle behind learning.

GeorgeTsiros
Автор

Const has its place and purpose, but I don't like the idea that everything that can be const should be declared const. It clutters up code really fast and the benefits are often questionable.

X_Baron