memesearch
Волдеморт-типы в C++

Волдеморт-типы в C++

Download Find similar pictures
Text on the meme
#include <iostream> #include <list> #include <string> auto who_must_not_be_named() { struct Voldemort { std::list<std::string> horcruxes; } the_lord{{"diary","ring","cup","locket","diadem","Nagini","Harry"}}; return the_lord; } int main() { auto somebody = who_must_not_be_named(); for (const auto& h: somebody.horcruxes) std::cout << h << std::endl; }
What it means

На изображении показан фрагмент кода на C++, создающий локальный тип Voldemort, который нельзя явно назвать за пределами области объявления. Функция возвращает список крестражей Волдеморта, а затем программа выводит их по одному; шутка основана на отсылке к Гарри Поттеру и названии «Волдеморт-тип». В комментариях о таком меме шутят о малоизвестной, но полезной возможности C++ и о том, что имя типа нельзя произнести. EN: The image shows a C++ code fragment creating a local type named Voldemort that cannot be explicitly named outside its declaration scope. The function returns Voldemort’s list of Horcruxes, and the program prints them one by one; the joke references Harry Potter and the term “Voldemort type.” This meme is used when joking about an obscure but useful C++ feature and a type whose name must not be spoken.

Who
Objects
Tags
Source
Type
image
Size
717×358 · 35.1 KiB
Mood
ироничный, абсурдный
Language
ru
Added