CRTP base that makes a derived type must‐use‐immediately and immovable.

Synopsis

Declared in <folly/lang/MustUseImmediately.h>

template<typename Derived>
struct must_use_immediately_crtp;

Description

Read the top‐of‐file doc, it's simpler to use wrap_must_use_immediately_t.

Templated to ensure all bases are distinct in a tower‐of‐wrappers, like TryAwaitable<now_task<T>>. Repeating a base would break the empty base optimization (EBO).

Type Aliases

Name

Description

folly_must_use_immediately_t

Member tag marking the derived type as must‐use‐immediately.

folly_private_safe_alias_t

Alias‐safety tag marking the type as unsafe for lifetime analysis.

Member Functions

Name

Description

must_use_immediately_crtp [constructor]

Constructors

~must_use_immediately_crtp [destructor]

Destroy the CRTP base.

operator=

Assignment operators

Derived Classes

Name

Description

co_result

Wraps a Try or result to be yielded from a coroutine as its completion.

co_result

Wraps a Try or result to be yielded from a coroutine as its completion.

wrap_must_use_immediately_t

Wrap a movable Inner type to make it must‐use‐immediately and immovable.

Created with MrDocs