Results for “shared”
Small, practical examples. Search by task or narrow things down below.
Share ownership with a counted smart pointer
C++: Copies of shared_ptr keep the owned value alive until the last owner is released.
C++✓ Tested
Update an atomic counter
Update an atomic counter in a complete Rust program using the standard library.
Rust✓ Tested
Use a context’s fallback value
Use a context’s fallback value with a small React component and explicit browser behavior.
React✓ Tested
Use React 19’s provider shorthand
Use React 19’s provider shorthand with a small React component and explicit browser behavior.
React✓ Tested
Validate access through a custom context hook
Validate access through a custom context hook with a small React component and explicit browser behavior.
React✓ Tested
Copy a multibyte interrupt-owned counter atomically
Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.
Arduino / C✓ Tested
Copy an array independently
Bash Scripts: A new array assignment copies element values rather than creating a shared reference.
Bash Scripts✓ Tested
Create a second name for the same file
Linux Commands: Use ln for a hard link and inspect the shared link count.
Linux Commands✓ Tested
Deliver a result through a promise and future
C++: A promise sets a shared state and its future retrieves the value.
C++✓ Tested
Find values common to two collections
C#: Intersect returns distinct values shared by the inputs.
C#✓ Tested
Supply a title and URL for link previews
HTML: Open Graph metadata describes a shared page without changing its visible content.
HTML✓ Tested
Undo a commit with a new commit
Reverse a change while preserving shared history.
revert✓ Tested