FIND YOUR NEXT FEW LINES

Results for “C++”

Small, practical examples. Search by task or narrow things down below.

3000 snippets foundClear filters
C#Collections & data structures

Process items by numeric priority

C#: PriorityQueue removes the item with the smallest priority value first.

C#✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested
JavaScriptPromises & iteration protocols

Produce a lazy sequence with a generator

JavaScript: A generator yields one value per iteration without building an intermediate array.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Produce a lazy sequence with a generator

TypeScript: A generator yields one value per iteration without building an intermediate array.

TypeScript✓ Tested
PythonStructured data & serialization

Produce compact deterministic JSON

Python: Sort dictionary keys and remove separator whitespace for a reproducible representation.

Python✓ Tested
AngularGetting Started

Project content into a reusable component

Project content into a reusable component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularComponents & communication

Project content into named slots

Project content into named slots with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Docker / ComposeCompose service options

Protect a Compose service’s root filesystem

Docker / Compose: read_only rejects writes to the image filesystem.

Docker / Compose✓ Tested
C++Tasks & synchronization

Protect a shared container with a mutex

C++: A scoped lock_guard releases the mutex when its scope ends.

C++✓ Tested
GoConcurrency & cancellation

Protect a shared counter

Protect a shared counter using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Protect shared mutable state with a mutex

Protect shared mutable state with a mutex in a complete Rust program using the standard library.

Rust✓ Tested
HTMLMetadata & document links

Provide a concise page description

HTML: A description meta element summarizes a document for clients that use that metadata.

HTML✓ Tested