ptrx

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package ptrx 提供指针相关的泛型工具函数。

包含指针的创建(Of)和安全解引用(Deref)等功能。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deref

func Deref[T any](p *T, fallback T) T

Deref 解引用 p,当 p 为 nil 时返回 fallback。

func Of

func Of[T any](v T) *T

Of 返回 v 的指针副本。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL