error C2039: 'unintialized_fill" : is not a member of 'std'
<p>I'm early in the stages of learning C++ and I'm working with classes.  After recreating the functionality of a vector with my own class, the next step is to create my own version of a string using my new Vec class.  I guess I'm too new to know how all these #includes interact but after searching many similar questions, it seems I'm just missing one somewhere.  But it doesn't make sense to me because I assume I'm including the correct header where it's needed.</p>

<p><strong>Str.h</strong></p>

<pre><code>#ifndef GUARD_Str_h
#define GUARD_Str_h

#include &lt;algorithm&gt;
#include &lt;iterator&gt;

#include "Vec.h"

class Str {
public:
    typedef Vec&lt;char&gt;::size_type size_type;

    Str() { }

    Str(size_type n, const char&amp; val): data(n, val) { }

    Str(const char* cp) {
        std::copy(cp, (cp + std::strlen(cp)), std::back_inserter(data));
    }
private:
    Vec&lt;char&gt; data;
};

#endif
</code></pre>

<p><strong>Vec.h</strong></p>

<pre><code>#ifndef GUARD_Vec_h
#define GUARD_Vec_h

#include &lt;cstring&gt;
#include &lt;memory&gt;
#include &lt;algorithm&gt;

template &lt;class T&gt; class Vec {
public:
    typedef T* iterator;
    typedef const T* const_iterator;
    typedef size_t size_type;
    typedef T value_type;
    typedef std::ptrdiff_t difference_type;
    typedef T&amp; reference;
    typedef const T&amp; const_reference;

    Vec() { create(); } //constructor
    explicit Vec(size_type n, const T&amp; val = T()) { create(n, val); } //constructor
    Vec(const Vec&amp; v) { create(v.begin(), v.end()); } //copy constructor
    ~Vec() { uncreate(); } //deconstructor

    size_type size() const { return (avail - data); }

    void push_back(const T&amp;);

    T&amp; operator[](size_type i) { return data[i]; }
    const T&amp; operator[](size_type i) const { return data[i]; }

    Vec&amp; operator=(const Vec&amp;);

    iterator begin() { return data; }
    const_iterator begin() const { return data; }
    iterator end() { return avail; }
    const_iterator end() const { return avail; }
private:
    iterator data;  //first element in the Vec
    iterator avail; //one past the last element in the Vec
    iterator limit; //one past the last availible space in the Vec

    std::allocator&lt;T&gt; alloc;

    void create();
    void create(size_type, const T&amp;);
    void create(const_iterator, const_iterator);

    void uncreate();

    void grow();
    void unchecked_append(const T&amp;);
};

template &lt;class T&gt; Vec&lt;T&gt;&amp; Vec&lt;T&gt;::operator=(const Vec&amp; v)
{
    if (v != this) {
        uncreate();

        create(v.begin(), v.end());
    }
    return *this;
}

template &lt;class T&gt; void Vec&lt;T&gt;::push_back(const T&amp; val)
{
    if (avail == limit)
        grow();
    unchecked_append(val);
}

template &lt;class T&gt; void Vec&lt;T&gt;::create()
{
    data = avail = limit = 0;
}

template &lt;class T&gt; void Vec&lt;T&gt;::create(size_type n, const T&amp; val)
{
    data = alloc.allocate(n);
    limit = avail = (data + n);
    std::unintialized_fill(data, avail, val);
}

template &lt;class T&gt; void Vec&lt;T&gt;::create(const_iterator beg, const_iterator end)
{
    data = alloc.allocate(end - beg);
    limit = avail = std::uninitialized_copy(beg, end, data);
}

template &lt;class T&gt; void Vec&lt;T&gt;::uncreate()
{
    if (data) {
        iterator iter = avail;
        while (iter != data)
            alloc.destroy(--iter);

        alloc.deallocate(data, (limit - data));
    }
    data = avail = limit = 0;
}

template &lt;class T&gt; void Vec&lt;T&gt;::grow()
{
    size_type new_size = std::max((2 * (limit - data)), difference_type(1));

    iterator new_data = alloc.allocate(new_size);
    iterator new_avail = std::uninitialized_copy(data, limit, new_data);

    uncreate();

    data = new_data;
    avail = new_avail;
    limit = (data + new_size);
}

template &lt;class T&gt; void Vec&lt;T&gt;::unchecked_append(const T&amp; val)
{
    alloc.construct(avail++, val);
}

#endif
</code></pre>

<p>Before I even wrote the Str class, when I was just testing my Vec class, everything worked fine.  I included Vec.h and could use my Vec in place of a vector.</p>

<p>Now with this new Str class that I made, I will include Str.h in my main source file and when I compile, it complains about std::uninitialized_copy not being a member of std.  I know that it's defined in the <strong>memory</strong> header and can't figure out how to get it to see it, no matter where I put the include.  I'm sure I'm just doing something wrong with the way classes interact with #includes but I'm new.  If someone could help out I'd appreciate it.</p>
