I need to write values of different types to a `std::wstringstream`. At one time we need to write one ore more values. I have tried to implement it like this: 

```
wstringstream _str;     

template<typename ValueType> //(1)
void WriteValue(const ValueType& val)
{
    _str << val;
}

template<typename ValueType> //(2)
void WriteValue(const std::vector<ValueType>& vals)
{
    for (auto it = vals.begin(); it!= vals.end(); ++it)
    {
        WriteValue<ValueType>(*it);
        _str << L" ";            
    }
}

template<typename ValueType>
void WriteRecord(const std::wstring& name, const ValueType & val)
{
     _str << name;
     WriteValue<ValueType>(val);
}

void Foo()
{
    int bar = 0;
    WriteRecord<int>(L"Lorem", bar); //it's okay

    std::vector<int> buz(4, 0);
    WriteRecord<int>(L"ipsum", buz); //it's error
}

```

I got the following error : 

```
"cannot convert argument 2 from 'std::vector< int, std::allocator < int > >' 
to 'int &'". As seen compiler tries to pass a vector to (1), not (2).

```

Why so? Is it possible to make it choose (2) specialized function template?