C++ and other lectures
Учебный канал в Телеграм: тут будут анонсы и ссылки на лекции и стримы. Написать автору: @Tilir Boosty автора: https://boosty.to/cpp_lects_rus
Show more📈 Analytical overview of Telegram channel C++ and other lectures
Channel C++ and other lectures (@cpp_lects_rus) in the Russian language segment is an active participant. Currently, the community unites 10 013 subscribers, ranking 12 151 in the Technologies & Applications category and 63 479 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 10 013 subscribers.
According to the latest data from 26 October, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by 51 over the last 30 days and by 6 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 85.16%. Within the first 24 hours after publication, content typically collects 33.61% reactions from the total number of subscribers.
- Post reach: On average, each post receives 8 525 views. Within the first day, a publication typically gains 3 365 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 98.
- Thematic interests: Content is focused on key topics such as компилятор, c++, llvm, struct, compilers.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Учебный канал в Телеграм: тут будут анонсы и ссылки на лекции и стримы.
Написать автору: @Tilir
Boosty автора: https://boosty.to/cpp_lects_rus”
Thanks to the high frequency of updates (latest data received on 27 October, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
template <auto T = []{}>
struct S {};
S a; S b;
В чем тут цимес. У нас T - это лямбда. И если мы таким образом определяем переменные, то в тип S записываются разные лямбды, и у нас получаются два разных типа:
static_assert(
!std::is_same_v<decltype(a), decltype (b)>
);
Если же мы явно укажем пустые треугольные скобки вот так:
S<> a, b;
static_assert(
std::is_same_v<decltype(a), decltype (b)>
);
То типы, внезапно, станут одинаковыми. Ну, мы один раз объявили тип, и две переменные этого типа.
А теперь вопрос в зал. А что если мы определим эти две переменные точно так же, как во втором варианте, но только без явного указания треугольных скобок?
S a, b;
Давайте вы попробуете угадать?
Ставя треугольные скобки мы исключаем вывод типов. Мы явно указываем, какой тип мы используем.
Но если у нас есть вывод типов, у нас компиляторы начинают вести себя по-разному.
clang падает с ошибкой
```
error: template arguments deduced as 'S<(lambda at <source>:4:20){}>' in declaration of 'a' and deduced as 'S<(lambda at <source>:4:20){}>' in declaration of 'b'
7 | S a, b;
```
А gcc считает, что это два разных типа.
```
static_assert(
!std::is_same_v<decltype(a), decltype (b)>
);
```
Пруф.
Вцелом доклад Константина был просто прекрасным, и я, наверное, понатырю сюда еще примеров из его доклада через пару месяцев. А когда он выйдет в открытый доступ - обязательно дам ссылку. Я был просто в восторге от дурки, которую он показывал.int x;
int *p = &x;
x = 0;
std::thread t([p]{ *p = 42; });
t.join();
use(x);
Компилятору в этом коде кажется ничто не мешает трансформировать его примерно так:
int x;
int *p = &x;
std::thread t([p]{ *p = 42; });
x = 0;
t.join();
use(x);
И тем самым создать UB (data race).
В лямбду уходит указатель, он не пересекается как область памяти, happens-before вроде нет и т.п.
—
На стриме я задумался и не нашёл что сказать, но сейчас после стрима я почитал стандарт и внезапно мы тут защищены.
The completion of the invocation of the constructor synchronizes with the beginning of the invocation of the copy of f.https://eel.is/c%2B%2Bdraft/thread.thread.constr#6 Так что happens-before всё-таки есть, кто бы мог подумать )) Дмитрий, который задавал вопрос, FYI. #boosty #questions
