Skip to content

The return behavior of Block expressions in manual is unclear description #14849

Closed
@tetsuharuohzeki

Description

@tetsuharuohzeki

The descriptions of Block expressions in the reference manual describes about its returning behavior:

If the final expression is omitted, the type and return value of the block are (), but if it is provided, the type and return value of the block are that of the expression itself.

I think this description has some unclear points,

  • Is this "return" means same as return expressions, or simply means "returning value"?
  • If this behave like return expressions, whether will value moved or copied?
    • if this behavior is under the terminology for rvalue, I seem we should describe it explicitly.

So how should we make this part more clearly description?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions