deductiongu...td::valarray(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… NAME πŸ’…

okay so bestie, welcome to the deductiongu...td::valarray(3) page from the C++ Standard Libary β€” yes, that’s the whole vibe. This one is literally about deduction guides for std::valarray. ✨


🌸 Synopsis 🌸

Defined in header <valarray>:

template< typename T, std::size_t cnt >                   (since C++17)
valarray( const T(&)[cnt], std::size_t ) -> valarray<T>;

This deduction guide is provided for std::valarray to allow deduction from array and size β€” and yes, bestie, note that deduction from pointer and size is covered by the implicit guides. no cap. 🫢


πŸŽ€ Example πŸŽ€

// Run this code

#include <iostream>
#include <valarray>

int main()
{
    int a[] = {1, 2, 3, 4};
    std::valarray va(a, 3); // uses explicit deduction guide
    for (int x : va)
        std::cout << x << ' ';
    std::cout << '\n';
}

🌈 Output 🌈

1 2 3

and that’s the whole iconic little page, bestie πŸ’– β€” source/version/date check: http://cppreference.com, 2024.06.10, and the page title was deductiongu...td::valarray(3). periodt. πŸ‘‘

πŸ“¦ where this page comes from