std::decay_t — один из самых полезных type traits в C++. Он имитирует процесс передачи параметра по значению, «разрушая» исходный тип.
🔄Что именно делает decay_t?
• Убирает cv-квалификаторы • Превращает ссылки в соответствующие типы без ссылок • Преобразует массивы в указатели • Преобразует функции в указатели на функции
💻Пример:
#include <type_traits> #include <iostream>
int main() { // const int& -> int static_assert(std::is_same_v<std::decay_t<const int&>, int>);
std::cout << "All assertions passed!" << std::endl; }
🚀Где это используется?
• В шаблонном программировании для упрощения работы с типами • В std::make_shared и std::make_unique для определения типа создаваемого объекта • При написании обобщенного кода, где нужна правильная дедукция типов
🔍 И да, название «decay» («разрушение») действительно отражает суть — тип «разрушается» до базового представления!
std::decay_t — один из самых полезных type traits в C++. Он имитирует процесс передачи параметра по значению, «разрушая» исходный тип.
🔄Что именно делает decay_t?
• Убирает cv-квалификаторы • Превращает ссылки в соответствующие типы без ссылок • Преобразует массивы в указатели • Преобразует функции в указатели на функции
💻Пример:
#include <type_traits> #include <iostream>
int main() { // const int& -> int static_assert(std::is_same_v<std::decay_t<const int&>, int>);
std::cout << "All assertions passed!" << std::endl; }
🚀Где это используется?
• В шаблонном программировании для упрощения работы с типами • В std::make_shared и std::make_unique для определения типа создаваемого объекта • При написании обобщенного кода, где нужна правильная дедукция типов
🔍 И да, название «decay» («разрушение») действительно отражает суть — тип «разрушается» до базового представления!
Importantly, that investor viewpoint is not new. It cycles in when conditions are right (and vice versa). It also brings the ineffective warnings of an overpriced market with it.Looking toward a good 2022 stock market, there is no apparent reason to expect these issues to change.
Export WhatsApp stickers to Telegram on iPhone
You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.