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 const-correctness of DopeVector #2

Open
tvercaut opened this issue May 7, 2023 · 1 comment
Open

Improve const-correctness of DopeVector #2

tvercaut opened this issue May 7, 2023 · 1 comment

Comments

@tvercaut
Copy link
Member

tvercaut commented May 7, 2023

Creating a dope vector with a read-only buffer is currently not supported and requires a const_cast:
https://github.com/tvercaut/distance_transform/blob/290463737800c1815bed28e4ef14062830a07016/bindings/python/py-distance-transform.cpp#L25-L28

A potential fix for this would be to use enable_if and SFINAE:
https://en.cppreference.com/w/cpp/types/enable_if

@tvercaut
Copy link
Member Author

An alternative could be to switch to a different tensor representation library, e.g.:
https://github.com/xtensor-stack/xtensor

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

No branches or pull requests

1 participant