Results for “C++”
Small, practical examples. Search by task or narrow things down below.
Assign a default to an empty or unset variable
Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.
Bash Scripts✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Avoid a shared mutable default argument
Python: Create a fresh list inside the function when the optional argument is omitted.
Python✓ Tested
Await multiple tasks while preserving result order
C#: Task.WhenAll returns results in the same order as the supplied tasks.
C#✓ Tested
Await several independent results
Preserve input order while awaiting multiple promises.
Promise.all✓ Tested
Bind a narrowed value using an @if alias
Bind a narrowed value using an @if alias with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Bind a style property
Bind a style property with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Build a minimum-priority queue
C++: Supply greater as the comparator because priority_queue defaults to the largest value first.
C++✓ Tested
Build a query from several named stages
SQL: Separate row selection from aggregation using two common table expressions.
SQL✓ Tested
Build a query from several named stages
SQL Server: Separate row selection from aggregation using two common table expressions.
SQL Server✓ Tested
Build a query from several named stages
Postgres: Separate row selection from aggregation using two common table expressions.
Postgres✓ Tested
Build a query from several named stages
SQLite: Separate row selection from aggregation using two common table expressions.
SQLite✓ Tested