I have a vector<unique_ptr<BaseClass>>, and I am adding new items to it by calling vec.push_back(std::make_unique<DerivedClass>()).
How can I check for nullptr using operator bool()?
I tried to use vec.back() directly, like so:
if((!vec.empty() && vec.back())
{
// yay!
}
else
{
//nay!
}
but it always returns with false, regardless of the contents of the pointer.