Results for “C++”
Small, practical examples. Search by task or narrow things down below.
Preallocate a slice’s capacity
Preallocate a slice’s capacity using a complete Go program with explicit sample inputs.
Go✓ Tested
Preconfigure some function arguments
Python: Use partial to produce a callable with selected arguments already bound.
Python✓ Tested
Preserve a failure after local cleanup
PowerShell: A bare throw inside catch rethrows the current exception.
PowerShell✓ Tested
Preserve a feature branch boundary with a merge commit
Git: No-ff records a merge commit even when a fast-forward would be possible.
Git✓ Tested
Preserve a fractional result
Arduino / C: Preserve a fractional result on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Preserve an aspect ratio
Reserve a 16:9 CSS box without a fixed height.
CSS✓ Tested
Preserve equal-key order while sorting records
C++: stable_sort retains encounter order for records whose selected sort keys compare equal.
C++✓ Tested
Preserve input state when tracked records reorder
Preserve input state when tracked records reorder with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Preserve line breaks while collapsing repeated spaces
CSS: Pre-line retains newlines but does not preserve all whitespace like pre-wrap does.
CSS✓ Tested
Preserve whitespace while wrapping
Use CSS pre-wrap for multiline text that retains spaces.
CSS✓ Tested
Prevent gaining privileges through exec
Docker / Compose: The no-new-privileges flag is visible in process status.
Docker / Compose✓ Tested
Prevent output chatter with separate thresholds
Arduino / C: Use different on and off thresholds to retain state between them.
Arduino / C✓ Tested