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

Improve get_edges; an iterator example, Fixes #26 #25

Merged
merged 2 commits into from
Dec 30, 2021

Conversation

jiangzhongshi
Copy link
Collaborator

No description provided.

src/wmtk/TetMesh.h Outdated Show resolved Hide resolved
friend bool operator==(const Tuple& a, const Tuple& t)
{
return (
std::tie(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use std::make_tuple instead of tie.

class IterableMesh : public TetMesh
{
public:
struct EdgeIterator
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find it easier to write a foreach_edges function with a custom callback function rather than have to implement your own iterator type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact, this PR is meant to initiate a discussion on how we want to proceed with the interface. That's why I am prototyping in a testing section.

@jiangzhongshi jiangzhongshi changed the title Improve get_edges; an iterator example Improve get_edges; an iterator example, Fixes #26 Dec 29, 2021
@jiangzhongshi jiangzhongshi self-assigned this Dec 29, 2021
@jiangzhongshi jiangzhongshi merged commit 6f8692e into main Dec 30, 2021
@jiangzhongshi jiangzhongshi deleted the zhongshi/iterator branch December 30, 2021 06:52
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.

None yet

2 participants