std::experi...:to_native,(3)

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

πŸ’… NAME

okay so bestie, welcome to the std::experi...:to_native,(3) page from the C++ Standard Library manual ✨ and today we're talking about std::experimental::to_fixed_size and std::experimental::to_native β€” two little icons whose whole job is converting your simd objects between ABIs πŸ¦‹ (yes, the to_compatible girlies are here too, stay tuned, they're in the synopsis iykyk πŸ’…).


🌸 SYNOPSIS

okay first thing first, everything below lives in the header <experimental/simd> β€” well, <experimental/simd>, not me fumbling the backtick, periodt. πŸŽ€

✨ (1) β€” to_fixed_size for simd

template< class T, class Abi >
fixed_size_simd<T, simd_size_v<T, Abi>>                      (1)
(parallelism TS v2)
to_fixed_size( const simd<T, Abi>& v ) noexcept;

πŸ¦‹ (2) β€” to_fixed_size for simd_mask

template< class T, class Abi >
fixed_size_simd_mask<T, simd_size_v<T, Abi>>                 (2)
(parallelism TS v2)
to_fixed_size( const simd_mask<T, Abi>& v ) noexcept;

πŸ’– (3) β€” to_native for fixed_size_simd

template< class T, std::size_t N >
native_simd<T>                                               (3)
(parallelism TS v2)
to_native( const fixed_size_simd<T, N>& v ) noexcept;

🌈 (4) β€” to_native for fixed_size_simd_mask

template< class T, std::size_t N >
native_simd_mask<T>                                          (4)
(parallelism TS v2)
to_native( const fixed_size_simd_mask<T, N>>& v ) noexcept;
lowkey that >> in (4) is exactly how it appears in the source, bestie β€” I am not touching it, not my business, no cap πŸ™ˆ

πŸŽ€ (5) β€” to_compatible for fixed_size_simd

template< class T, std::size_t N >
simd<T>                                                      (5)
(parallelism TS v2)
to_compatible( const fixed_size_simd<T, N>& v ) noexcept;

πŸ‘‘ (6) β€” to_compatible for fixed_size_simd_mask

template< class T, std::size_t N >
simd_mask<T>                                                 (6)
(parallelism TS v2)
to_compatible( const fixed_size_simd_mask<T, N>& v )
noexcept;

So what do all six actually do? They return a simd or simd_mask object with the same elements, but a different ABI πŸ”₯ literally the same vibe, different outfit, slay πŸ’…

⚠️ and here's the receiving-grammar moment: (3)–(6) do not participate in overloading resolution unless N is the same as the size of the return type. that's it, that's the rule, respect it 🫢

πŸ’œ PARAMETERS

  • v β€” the input simd or simd_mask object πŸ“ (like, the thing you're converting, the main character, the one we're rooting for)

πŸ’€ RETURN VALUE

The simd or simd_mask object with the specified ABI ✨ β€” same contents, new ABI energy, iconic behaviour, no notes πŸ‘‘


😭 EXAMPLE

This section is incomplete.

Reason: no example.

not me crying, there's literally no example to give you 😭 the page says it's incomplete and gives us "no example" and honestly? we respect the honesty.

🧚 CATEGORY

  • Todo: no example πŸŽ€

and that's the whole page, bestie! catch you on the next one πŸ’– source and version for the receipts: http://cppreference.com, dated 2024.06.10, from the std::experi...:to_native,(3) page itself β€” mwah, bye, ily, drink water 🌸✨🫢

πŸ“¦ where this page comes from