Question: I have got a virtual class `basic_action`. Class `sippeers` inherits class `basic_action`. To store instances of `sippeers` classes I'm using `boost::ptr_list`. Here's code example:

```
boost::ptr_list<basic_action> ActionsList;
sippeers spclass;
ActionsList.push_back(&spclass);
basic_action *sp = ActionsList.front();

```

Here I create an instance of `prt_list` with pointers to instances of my `basic_action` classes.
Next I make new instance of my `sippeers` class.
Next I insert pointer to `sippeers` class into `ptr_list`.

The last string fails. 

> 
> Cannot convert from 'basic\_action' to
>  'basic\_action \*'.
> 
> 
> 

But there IS a `basic_action *` inside, not `basic_action`!

Answer: 
`boost::ptr_list::front()` returns a reference to the templated type, not a pointer.

So in this case it's returning a `basic_action&`. 

See the documentation [here](http://www.boost.org/doc/libs/1_46_1/libs/ptr_container/doc/ptr_sequence_adapter.html) for `ptr_sequence_adapter`, from which `ptr_list` is derived. 

So your code should read: 

```
boost::ptr_list<basic_action> ActionsList;
sippeers spclass;
ActionsList.push_back(&spclass);
basic_action &sp = ActionsList.front();

```
If you look at the [header](http://www.boost.org/doc/libs/1_46_1/libs/ptr_container/doc/ptr_sequence_adapter.html) then you will see that:

```
template
<
    class T,
    class VoidPtrSeq,
    class CloneAllocator = heap_clone_allocator
>
class ptr_sequence_adapter
{
public: // construct/copy/destroy
    template< class InputIterator >
    assign( InputIterator first, InputIterator last );
    template< class InputRange >
    assign( const InputRange& e );

public: // element access
    T&        front();

```

(Note; ptr\_list directly inherits from ptr\_sequence\_adapter) So you are getting the type, not a reference to the type; it does an automatic dereference for you:

```
basic_action sp = ActionsList.front();

```

is correct.