std::experi...d_flag_type(3)

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

πŸ’– NAME πŸ’–

okay so bestie, this page is from the C++ Standard Libary manual β€” yes, that's literally how the header spells it, we are not fixing it, it's iconic β€” and the page title is std::experi...d_flag_type(3) (the header shows it twice up top, periodt).

The NAME line is doing a little echo moment: std::experimental::is_simd_flag_type β€” std::experimental::is_simd_flag_type again. Slay.


πŸ” Synopsis

Defined in header <experimental/simd>:

template< class T >                    (parallelism TS v2)
struct is_simd_flag_type;

So here's the vibe: if T is a valid type for the second argument to copy_from, copy_to, or the corresponding load constructors of simd or simd_mask, then this trait provides the member constant value equal to true. For any other type, value is false. No cap. πŸ’…

🧩 Template parameters

  • T β€” a type to check 🫢

🧚 Helper variable template

This one is also (parallelism TS v2):

template< class T >
inline constexpr bool is_simd_flag_type_v =
    is_simd_flag_type<T>::value;

πŸ‘‘ Inherited from std::integral_constant

πŸŽ€ Member constants

  • value β€” true if T is a load/store flag tag type, false otherwise; [static] (public static member constant) ✨

🌸 Member functions

  • operator bool β€” converts the object to bool, returns value (public member function)
  • operator() β€” returns value; (C++14) (public member function)

πŸ¦‹ Member types

  • value_type β†’ bool
  • type β†’ std::integral_constant<bool, value>

✨ Example

// Run this code

#include <experimental/simd>
#include <iostream>

int main()
{
    namespace stdx = std::experimental;
    std::cout << std::boolalpha
              << stdx::is_simd_flag_type_v<stdx::element_aligned_tag>
              << '\n'
              << stdx::is_simd_flag_type_v<int> << '\n';
}

πŸ“€ Output:

true
false

πŸ”— See also

  • is_abi_tag β€” checks if a type is an ABI tag type (parallelism TS v2) (class template)

later bestie πŸ’– β€” source: http://cppreference.com, version/date: 2024.06.10, page: std::experi...d_flag_type(3) 🌈

πŸ“¦ where this page comes from