std::experi...::operator--(3)

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

πŸ’… std::experi...::operator--(3) πŸ’…

okay so this page is from the C++ Standard Libary manual, bestie β€” no cap, that spelling is literally in the original, and we keep it. The page title is std::experi...::operator--(3), and the header repeats that title again; consider it folded in with a little bow πŸŽ€. This is highkey the page for the increment/decrement operators on std::experimental::simd, and it's giving parallelism TS v2 energy ✨.

πŸ¦‹ NAME πŸ¦‹

std::experimental::simd::operator++,std::experimental::simd::operator-- β€” that's the NAME line, periodt. The page repeats it exactly: std::experimental::simd::operator++,std::experimental::simd::operator--. πŸ’–

✨ Synopsis ✨

simd& operator++() noexcept;     (1) (parallelism TS v2)
simd operator++( int ) noexcept; (2) (parallelism TS v2)
simd& operator--() noexcept;     (3) (parallelism TS v2)
simd operator--( int ) noexcept; (4) (parallelism TS v2)

It applies the increment or decrement operator on each element of the simd. 🫢

  • (1) β€” increments all values in the simd by 1 and returns a reference to itself.
  • (2) β€” increments all values in the simd by 1 and returns a copy of itself before the operation.
  • (3) β€” decrements all values in the simd by 1 and returns a reference to itself.
  • (4) β€” decrements all values in the simd by 1 and returns a copy of itself before the operation.

πŸŽ€ Example πŸŽ€

// Run this code

#include <cstddef>
#include <experimental/simd>
#include <iostream>
namespace stdx = std::experimental;

void print(auto rem, auto const& a)
{
    std::cout << rem << ": ";
    for (std::size_t i{}; i != std::size(a); ++i)
        std::cout << a[i] << ' ';
    std::cout << '\n';
}

int main()
{
    stdx::native_simd<int> p = -2;
    print('p', p);

    ++p;
    print('p', p);

    auto q = p--;
    print('p', p);
    print('q', q);
}

🌈 Possible output: 🌈

p: -2 -2 -2 -2
p: -1 -1 -1 -1
p: -2 -2 -2 -2
q: -1 -1 -1 -1

πŸ’– That's the whole page, bestie! Cute sign-off with the footer tea: source http://cppreference.com, version/date 2024.06.10, page std::experi...::operator--(3). Mwah πŸ’…βœ¨
πŸ“¦ where this page comes from