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

TPZAutoPointer<T> missing equality comparison operator #172

Open
orlandini opened this issue Feb 23, 2023 · 0 comments
Open

TPZAutoPointer<T> missing equality comparison operator #172

orlandini opened this issue Feb 23, 2023 · 0 comments

Comments

@orlandini
Copy link
Member

Codes such as

T *a, *b;
//code
TPZAutoPointer<T> ptr1(a);
TPZAutoPointer<T> ptr2(b);
if(ptr1 == ptr2){
  //do something
}

won't work as expected.
Both ptr1 and ptr2 will be converted to bool and evaluate to true as long as a and b are non null, therefore we are not testing if they point to the same reference.

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