null_deleter

| Home | Libraries | People | FAQ | More

## null_deleter

### Authors

- Andrey Semashev

### Header <boost/core/null_deleter.hpp>

The header `<boost/core/null_deleter.hpp>` defines the `boost::null_deleter` function object, which can be used as a deleter with smart pointers such as `unique_ptr` or `shared_ptr`. The deleter doesn't do anything with the pointer provided upon deallocation, which makes it useful when the pointed object is deallocated elsewhere.

#### Example

    std::shared_ptr< std::ostream > make_stream()
    {
        return std::shared_ptr< std::ostream >(&std::cout, boost::null_deleter());
    }