Skip to content

CWG3044 [stmt.expand] iter initialization for iterating expansion statements #725

Description

@jakubjelinek

Full name of submitter (unless configured in github; will be published with the issue): Jakub Jelinek

Reference (section label): [stmt.expand]

Link to reflector thread (if any):

Issue description:
[stmt.expand]/(5.2) includes

  static constexpr auto iter = begin + i;

where clearly i is an integer constant going from 0 to N-1, but doesn't say what type i has. For enumerating and destructuring expansion statements I think that doesn't matter, but begin + i is often a call to an overloaded operator and in that case it matters if i
has say std::size_t type, or std::ptrdiff_t, or int, or unsigned long long. Depending on that the code could work differently.

Suggested resolution:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions