std::get(std::complex)(3)

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

✨ NAME ✨

std::get(std::complex) β€” literally std::get(std::complex) 🫢

Okay bestie, you're looking at std::get(std::complex)(3) from the C++ Standard Libary manual, and it's giving tiny-accessor-with-main-character-energy ✨.


🌸 Synopsis 🌸

Defined in header <complex>:

template< std::size_t I >                                    (1)
(since C++26)
friend constexpr T& get( std::complex<T>& x );
template< std::size_t I >                                    (2)
(since C++26)
friend constexpr const T& get( const std::complex<T>& x );
template< std::size_t I >                                    (3)
(since C++26)
friend constexpr T&& get( std::complex<T>&& x );
template< std::size_t I >                                    (4)
(since C++26)
friend constexpr const T&& get( const std::complex<T>&& x );

So what's the vibe? It returns a reference to the real or imaginary part from a complex when I == 0 or I == 1, respectively. It is mainly provided for structured binding support. No cap πŸ’….


πŸ“ Parameters πŸ“

  • x β€” a complex.

πŸ’– Return value πŸ’–

  • 1-4) β€” A reference to the real or imaginary part from the stored one when I == 0 or I == 1, respectively. πŸ”₯

🌈 Example 🌈

This section is incomplete Reason: no example

The docs are literally saying "no example yet" 😭 β€” iconic honesty, honestly.


πŸ¦‹ See also πŸ¦‹

  • Structured binding (C++17) β€” binds the specified names to sub-objects or tuple elements of the initializer
  • get(std::tuple) β€” tuple accesses specified element (C++11) (function template)
  • get(std::pair) β€” accesses an element of a pair (C++11) (function template)
  • get(std::array) β€” accesses an element of an array (C++11) (function template)

🏷️ Category 🏷️

  • Category: Todo no example

Okay that's the whole vibe πŸ’« Source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::get(std::complex)(3). Stay iconic, bestie πŸ’…βœ¨

πŸ“¦ where this page comes from