CPP_LECTS_RUS Telegram 210
Всем привет. Очередная лекция по компиляторам завтра в 9 утра, а сегодня вечер пятницы и небольшой брейн-тизер по C++.

template<typename T = void>
int foo(int x) { return 1; }

int foo(...) { return 2; }

template<typename T = void>
int bar() { return 1; }

int bar(...) { return 2; }

int main() {
std::cout << foo(2) << std::endl; // ?
std::cout << bar() << std::endl; // ???
}


https://godbolt.org/z/qfsEvxh4E

Громадное спасибо за него Владиславу Белову https://www.tgoop.com/you_are_RTshnik наткнувшемуся на эту красоту во время выполнения одного из моих заданий.

Задача довольно обычная — объяснить в чём разница с детальными ссылками на C++23. Призов не будет, кроме зрительских симпатий.

P. S. книгу обещают перепечатать к 15 ноября.

UPD: Уважаемый подписчик Артём Колпаков @ddvamp развил и усилил пример до https://godbolt.org/z/ab31ah199

#questions #cpp_postgraduate
🔥50🤪10👍8🤔2🥴1🌚1🫡1💘1



tgoop.com/cpp_lects_rus/210
Create:
Last Update:

Всем привет. Очередная лекция по компиляторам завтра в 9 утра, а сегодня вечер пятницы и небольшой брейн-тизер по C++.

template<typename T = void>
int foo(int x) { return 1; }

int foo(...) { return 2; }

template<typename T = void>
int bar() { return 1; }

int bar(...) { return 2; }

int main() {
std::cout << foo(2) << std::endl; // ?
std::cout << bar() << std::endl; // ???
}


https://godbolt.org/z/qfsEvxh4E

Громадное спасибо за него Владиславу Белову https://www.tgoop.com/you_are_RTshnik наткнувшемуся на эту красоту во время выполнения одного из моих заданий.

Задача довольно обычная — объяснить в чём разница с детальными ссылками на C++23. Призов не будет, кроме зрительских симпатий.

P. S. книгу обещают перепечатать к 15 ноября.

UPD: Уважаемый подписчик Артём Колпаков @ddvamp развил и усилил пример до https://godbolt.org/z/ab31ah199

#questions #cpp_postgraduate

BY C++ and other lectures




Share with your friend now:
tgoop.com/cpp_lects_rus/210

View MORE
Open in Telegram


Telegram News

Date: |

Image: Telegram. Telegram channels enable users to broadcast messages to multiple users simultaneously. Like on social media, users need to subscribe to your channel to get access to your content published by one or more administrators. Telegram message that reads: "Bear Market Screaming Therapy Group. You are only allowed to send screaming voice notes. Everything else = BAN. Text pics, videos, stickers, gif = BAN. Anything other than screaming = BAN. You think you are smart = BAN. With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures. Today, we will address Telegram channels and how to use them for maximum benefit.
from us


Telegram C++ and other lectures
FROM American