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

fix: fix building on C++20 - fix removal of shared_ptr.unique #33

Merged
merged 2 commits into from
Dec 30, 2021

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Dec 3, 2021

This replaces the removed shared_ptr.unique with .use_count() == 1
See this for the explanation
https:// en.cppreference.com/w/cpp/memory/shared_ptr/unique

Cherry-picked from #28

C:/opennurbs/opennurbs_mesh.cpp:14834:34: error: no member named 'unique' in 'std::shared_ptr<ON_Mesh>'
    if (false == item->m_mesh_sp.unique())
                 ~~~~~~~~~~~~~~~ ^

This replaces the removed shared_ptr.unique with .use_count() == 1
See this for the explanation
https:// en.cppreference.com/w/cpp/memory/shared_ptr/unique
Copy link
Member

@sbaer sbaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really hard to read. I would recommend changing this to
if (item->m_mesh_sp.use_count() != 1)

@aminya
Copy link
Contributor Author

aminya commented Dec 29, 2021

This is really hard to read. I would recommend changing this to if (item->m_mesh_sp.use_count() != 1)

Fixed in 71e81b4

@sbaer sbaer merged commit 19e5595 into mcneel:7.x Dec 30, 2021
danielgronlund pushed a commit to danielgronlund/opennurbs that referenced this pull request Apr 3, 2024
fix: fix building on C++20 - fix removal of shared_ptr.unique

Thanks for the fix
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