deductiongu...forstd::pair(3)
okay bestie, you're looking at the deductiongu...forstd::pair(3) page from the C++ Standard Libary manual, and it's lowkey iconic β¨
π NAME π
deductionguidesforstd::pair β deductionguidesforstd::pair (yes, it's literally the same thing twice, that's the manpage vibe π)
π¦ Synopsis π¦
Defined in header <utility> β don't forget that part, bestie π«Ά
template<class T1, class T2> (since C++17)
pair(T1, T2) -> pair<T1, T2>;
So there's exactly one deduction guide provided for std::pair, and it's there to account for the edge cases missed by the implicit deduction guides β in particular, non-copyable arguments and array to pointer conversion. periodt π
π Example π
// Run this code
#include <utility>
int main()
{
int a[2], b[3];
std::pair p{a, b}; // explicit deduction guide is used in this case
}
That's the whole flex: std::pair p{a, b}; and the explicit deduction guide is used in this case, fr fr π¦
okay that's the page, bestie β mwah π source/version: http://cppreference.com, date: 2024.06.10.
π¦ 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