👨💻 Сегодня покажу вам удобный способ, как избавиться от болей с #include в больших C++ проектах.
Когда проект растёт, количество инклудов становится пугающим. Компиляция тормозит, зависимости запутаны, порядок подключения начинает влиять на поведение программы… Знакомо?
📌Решение — Precompiled Headers (PCH).
Это не магия, а вполне рабочая практика. Всё просто:
1. Создаём файл pch.h, в котором собираем самые часто используемые инклюды:
// pch.h #pragma once #include <iostream> #include <vector> #include <map> // и т.д.
2. Добавляем его в компиляцию с флагом:
g++ -x c++-header pch.h -o pch.h.gch
3. Теперь любой другой файл, который первым инклудит pch.h, компилируется быстрее.
⚡️Бонус: современные сборочные системы, вроде CMake, умеют работать с PCH почти автоматически. Достаточно:
👨💻 Сегодня покажу вам удобный способ, как избавиться от болей с #include в больших C++ проектах.
Когда проект растёт, количество инклудов становится пугающим. Компиляция тормозит, зависимости запутаны, порядок подключения начинает влиять на поведение программы… Знакомо?
📌Решение — Precompiled Headers (PCH).
Это не магия, а вполне рабочая практика. Всё просто:
1. Создаём файл pch.h, в котором собираем самые часто используемые инклюды:
// pch.h #pragma once #include <iostream> #include <vector> #include <map> // и т.д.
2. Добавляем его в компиляцию с флагом:
g++ -x c++-header pch.h -o pch.h.gch
3. Теперь любой другой файл, который первым инклудит pch.h, компилируется быстрее.
⚡️Бонус: современные сборочные системы, вроде CMake, умеют работать с PCH почти автоматически. Достаточно:
Telegram is a cloud-based instant messaging service that has been making rounds as a popular option for those who wish to keep their messages secure. Telegram boasts a collection of different features, but it’s best known for its ability to secure messages and media by encrypting them during transit; this prevents third-parties from snooping on messages easily. Let’s take a look at what Telegram can do and why you might want to use it.
Telegram Be The Next Best SPAC
I have no inside knowledge of a potential stock listing of the popular anti-Whatsapp messaging app, Telegram. But I know this much, judging by most people I talk to, especially crypto investors, if Telegram ever went public, people would gobble it up. I know I would. I’m waiting for it. So is Sergei Sergienko, who claims he owns $800,000 of Telegram’s pre-initial coin offering (ICO) tokens. “If Telegram does a SPAC IPO, there would be demand for this issue. It would probably outstrip the interest we saw during the ICO. Why? Because as of right now Telegram looks like a liberal application that can accept anyone - right after WhatsApp and others have turn on the censorship,” he says.