Results for “Ownership & optional values”
Small, practical examples. Search by task or narrow things down below.
Give a function an optional argument
Let callers omit a value while keeping nounset enabled.
optional argument✓ Tested
Give an optional property a default
Handle missing object fields with nullish coalescing.
optional✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
Group related values in nested structures
C: Nested members model a record that owns another simple record.
C✓ Tested
Handle an optional dependency
Handle an optional dependency with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Handle an optional value
Handle an optional value in a complete Rust program using the standard library.
Rust✓ Tested
Include missing values in a not-equal filter
SQL: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
SQL✓ Tested
Include missing values in a not-equal filter
SQL Server: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
SQL Server✓ Tested
Include missing values in a not-equal filter
Postgres: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
Postgres✓ Tested
Include missing values in a not-equal filter
SQLite: Ordinary inequality does not include NULL; explicitly include it when that is the intended rule.
SQLite✓ Tested
Insert values into a multiline template
PowerShell: A double-quoted here-string expands variable references.
PowerShell✓ Tested
Inspect bytes as hexadecimal values
Linux Commands: Use od with explicit formatting and no address column.
Linux Commands✓ Tested