# UnsafePtrList<T>.ReadOnly

> A read only for an UnsafePtrList\<T\>.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public struct UnsafePtrList<T>.ReadOnly
```

## Remarks

Use [UnsafePtrList\<T>.AsReadOnly](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/asreadonly.md) to create a read only for a list.

## Fields

| Value                                                                                                         | Description                      |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [Length](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/length.md) | The number of elements.          |
| [Ptr](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/ptr.md)       | The internal buffer of the list. |

## Properties

| Property                                                                                                            | Description                                                     |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [IsCreated](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/iscreated.md) | Whether this list has been allocated (and not yet deallocated). |
| [IsEmpty](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/isempty.md)     | Whether the list is empty.                                      |

## Methods

| Method                                                                                                            | Description                                                                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [Contains](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/contains.md) | Returns true if the list contains at least one occurrence of a specific pointer. |
| [IndexOf](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeptrlist1/readonly/indexof.md)   | Returns the index of the first occurrence of a specific pointer in the list.     |
