Barclays Interview Question

What's the purpose of a smart pointer?