Question: According to [cppreference](http://en.cppreference.com/w/cpp/io/basic_ostringstream), **std::basic\_ostringstream** can be instantiated with a custom allocator. Since C++11, allocators are allowed to have state and my custom allocator class does have internal per-instance state (actually each allocator instance has a pointer to an instance of a **MemPool** class, to which it forwards all allocation requests). This is why my allocator type can't just simply be default-constructed and be expected to work because after all, where is it going to get the address of the **MemPool** instance it's supposed to use from?

Unfortunately, if you take a look at the [constructor prototypes](http://en.cppreference.com/w/cpp/io/basic_ostringstream/basic_ostringstream) of **std::basic\_ostringstream**, you can see that none of the supported constructors actually take an allocator instance! I'm pretty sure that **std::basic\_ostringstream** will have to make some allocation(s) to construct its resulting string, and I really want it to use my allocator for those, but how is it going to do that if I have no way of telling it which specific **MemPool** instance to use??

Have I overlooked something here? I feel like I must have but I sure don't see how at the moment.

Answer: 
***Demo: <http://jsfiddle.net/abhitalks/xE4q4/>***

1. Its advisable to define your transition in the base class and not on the `:hover` or other *change* pseudo-class.
2. Specify a background on the element in the base class itself.
3. Just specify what change you want in your `:hover` pseudo-class.

*Relevant CSS*:

```
.seg1 {
    border-radius: 50%;
    border: 1px solid #b1ebeb;
    height: 250px; width: 250px;
    text-align: center;
    background: url('your image') no-repeat center center #f1fbfb;
    background-size: 0px;
    transition: all 1s ease-in-out;
}
.seg1:hover {
    background-size: 100%;
}

```
you could try this for example:

<http://jsfiddle.net/3q9ex/>

```
background-position: -100px center;

```

And play with this:

```
background-size: cover;

```