class PevSearch
{
boost::shared_ptr<FilterProvider> filterProvider;
public:
void RegisterFilter(const boost::shared_ptr<FilterProvider>& toRegister)
{
filterProvider = toRegister;
}
const boost::shared_ptr<const FilterProvider>& GetFilter() const
{
return filterProvider; // Compiler reports "Returning address of local
// variable or temporary"
}
};
I don't see what's local or temporary about filterProvider
here. Why would MSVC be reporting this error?
The specific warning is:
warning C4172: returning address of local variable or temporary
Thanks!
Billy3
EDIT: In general, I know what the warning means, but I'm curious where the temporary is coming from here.