Functions in C++ with const parameters and why (bonus std::is_const) | Modern Cpp Series Ep. 22

Functions in C++ with const parameters and why (bonus std::is_const) | Modern Cpp Series Ep. 22

Mike Shah

3 года назад

7,641 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@dhanushs1802
@dhanushs1802 - 28.07.2022 10:52

Very neatly explained. Thank you

Ответить
@riscaverse
@riscaverse - 30.10.2023 05:24

When you call the PassByReference(x); why are you able to pass in x and not the address of or reference of x. Such as PassByReference(&x); Because you declared your function to accept references. Thank you

Ответить
@soulimanemammar2909
@soulimanemammar2909 - 28.11.2023 20:19

const T& let you also pass rvalues of type T to the function otherwise we have to pass an lvalue

Ответить
@IgorLisx
@IgorLisx - 21.05.2024 05:22

Looks like `const` is equivalent to `final` in Java

Ответить
@fullstop-e1e
@fullstop-e1e - 24.07.2024 11:42

Thank you

Ответить
@guilherme5094
@guilherme5094 - 12.08.2024 21:49

One more👍!

Ответить