deductiongu...td::weak_ptr(3)
πΈ NAME πΈ
okay so bestie, welcome to the deductionguidesforstd::weak_ptr page β it's a (3) page from the C++ Standard Libary. The NAME is literally deductionguidesforstd::weak_ptr β deductionguidesforstd::weak_ptr. yes, same thing twice, iconic.
β¨ Synopsis β¨
it's giving header info, so here's the setup:
- Defined in header
<memory> - Since C++17:
template< class T >
weak_ptr( std::shared_ptr<T> ) -> weak_ptr<T>;
There's literally one deduction guide provided for std::weak_ptr, and its whole job is to account for the edge case that the implicit deduction guides missed. no cap π«Ά
π Example π
run this code, bestie:
// Run this code
#include <memory>
int main()
{
auto p = std::make_shared<int>(42);
std::weak_ptr w{p}; // explicit deduction guide is used in this case
}
That little comment? It's saying the explicit deduction guide is used in this case. periodt π
mwah π this page comes from http://cppreference.com, dated 2024.06.10, and it's the deductiongu...td::weak_ptr(3) page. bye bestie π¦
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms