Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around MSVC error C2580 #1659

Closed
wants to merge 1 commit into from

Conversation

zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Dec 7, 2024

Refs #1513.

It seems to be a bug of MSVC that it can not distinguish between:

  array& operator=(array&& other) && = delete;
  array& operator=(array&& other) & = default;

and gives error:

C:\cygwin\home\zcbenz\codes\mlx\mlx/array.h(70,10): error C2580: 'mlx::core::array
 &mlx::core::array::operator =(mlx::core::array &&) &': multiple versions of a def
aulted special member functions are not allowed [C:\cygwin\home\zcbenz\codes\mlx\b
uild\mlx.vcxproj]

"multiple versions of a defaulted special member functions are not allowed"
@awni
Copy link
Member

awni commented Dec 7, 2024

It looks like it was fixed alreaady? https://developercommunity.visualstudio.com/t/error-c2580-multiple-versions-of-a-defaulted-speci/468431

Is it reasonable to use a newer version of MSVC? The fix looks like from 4+ years ago..

@zcbenz
Copy link
Contributor Author

zcbenz commented Dec 8, 2024

Updated my Visual Studio and it is gone 👍

The bug was 4 years ago but the fix only got released a few months ago, we are quite lucky this time.

@zcbenz zcbenz closed this Dec 8, 2024
@zcbenz zcbenz deleted the array-default-assign branch December 8, 2024 01:03
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.

2 participants