Indicates that the instance's storage is sequentially replicated Length times.
public ref class InlineArrayAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Struct, AllowMultiple=false)]
public sealed class InlineArrayAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Struct, AllowMultiple=false)>]
type InlineArrayAttribute = class
inherit Attribute
Public NotInheritable Class InlineArrayAttribute
Inherits Attribute
The following example shows how to declare an inline array type with eight float
values.
[InlineArray(8)]
struct Float8InlineArray
{
private float _value;
}
This attribute can be used to annotate a struct
type with a single field. The runtime replicates that field in the actual type layout as many times as is specified.
Important
In .NET 9 and later versions, the default implementations of Equals()
and GetHashCode()
for types marked with this attribute throw NotSupportedException. You must override both Equals(Object) and GetHashCode if they will be used.
Gets the number of sequential fields to replicate in the inline array type.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute) MethodsCollaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4