is there a way to do what I'm trying to do without using pointers or references?
Here's the code:
Node getSmallest() {
if (openList.empty())
return 0; // syntax error
// some other code
}
You can use boost::optional
to return an optional value. Or wait for C++14 and use std::optional
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With