Skip to content

Make DataView iterator implementation std::forward_iterator compatible for cpp20#2976

Draft
mlxd wants to merge 1 commit into
mainfrom
mlxd/fwd_it_dataview
Draft

Make DataView iterator implementation std::forward_iterator compatible for cpp20#2976
mlxd wants to merge 1 commit into
mainfrom
mlxd/fwd_it_dataview

Conversation

@mlxd

@mlxd mlxd commented Jun 24, 2026

Copy link
Copy Markdown
Member

Context: The given DataView class has an internal implementation of an iterator that is not compatible with the C++20 std::forward_iterator due to the use of a reference. A class with a reference member has its implicitly-declared copy-assignment operator deleted (see here). As a result, the constract for std::forward_iterator is broken, which causes failures on MSCV due to the iterator missing a copy assignment operator.

Description of the Change: The fix is to simply replace the reference with a pointer.

Benefits: Ensure the DataView class for the runtime compilation can proceed with all major toolchains.

Possible Drawbacks:

Related GitHub Issues: PennyLaneAI/pennylane-lightning#1396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant