CPPPROGLIB Telegram 6162
🍩 Фича: std::byteswap

Конвертация между little/big endian теперь можно производить за один вызов функции.


До:
uint32_t swap(uint32_t x) {
return ((x >> 24) & 0xff) | ((x << 8) & 0xff0000) |
((x >> 8) & 0xff00) | ((x << 24) & 0xff000000);
}


После:
uint32_t swapped = std::byteswap(value);



✏️ Практика:

• Сетевые протоколы
• Чтение бинарных файлов
• Кросс-платформенная сериализация

Библиотека C/C++ разработчика

#буст
Please open Telegram to view this post
VIEW IN TELEGRAM
👍53



tgoop.com/cppproglib/6162
Create:
Last Update:

🍩 Фича: std::byteswap

Конвертация между little/big endian теперь можно производить за один вызов функции.


До:

uint32_t swap(uint32_t x) {
return ((x >> 24) & 0xff) | ((x << 8) & 0xff0000) |
((x >> 8) & 0xff00) | ((x << 24) & 0xff000000);
}


После:
uint32_t swapped = std::byteswap(value);



✏️ Практика:

• Сетевые протоколы
• Чтение бинарных файлов
• Кросс-платформенная сериализация

Библиотека C/C++ разработчика

#буст

BY Библиотека C/C++ разработчика | cpp, boost, qt


Share with your friend now:
tgoop.com/cppproglib/6162

View MORE
Open in Telegram


Telegram News

Date: |

best-secure-messaging-apps-shutterstock-1892950018.jpg During a meeting with the president of the Supreme Electoral Court (TSE) on June 6, Telegram's Vice President Ilya Perekopsky announced the initiatives. According to the executive, Brazil is the first country in the world where Telegram is introducing the features, which could be expanded to other countries facing threats to democracy through the dissemination of false content. Matt Hussey, editorial director of NEAR Protocol (and former editor-in-chief of Decrypt) responded to the news of the Telegram group with “#meIRL.” You can invite up to 200 people from your contacts to join your channel as the next step. Select the users you want to add and click “Invite.” You can skip this step altogether. To edit your name or bio, click the Menu icon and select “Manage Channel.”
from us


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM American