I'm trying to convert this function to a template:

```cpp
std::vector<std::string> StrSplit(const std::string& i_str, const std::string& i_delim)
{
    std::vector<std::string> result;

    size_t found = i_str.find(i_delim);
    size_t startIndex = 0;

    while (found != std::string::npos)
    {
        result.emplace_back(std::string(i_str.begin() + startIndex, i_str.begin() + found));
        startIndex = found + i_delim.size();
        found = i_str.find(i_delim, startIndex);
    }
    if (startIndex != i_str.size())
        result.emplace_back(std::string(i_str.begin() + startIndex, i_str.end()));
    return result;
}

```

The goal is to make it support `string` and `wstring`
what I tried:

```cpp
template <typename T, typename T2>
std::vector<T> StrSplit(T& i_str, T2& i_delim)
{
    std::vector<T> result;

    size_t found = i_str.find(i_delim);
    size_t startIndex = 0;

    while (found != T::npos)
    {
        result.emplace_back(T(i_str.begin() + startIndex, i_str.begin() + found));
        startIndex = found + i_delim.size();
        found = i_str.find(i_delim, startIndex);
    }
    if (startIndex != i_str.size())
        result.emplace_back(T(i_str.begin() + startIndex, i_str.end()));
    return result;
}

```

I'm getting this error: `binary '=': no operator found which takes a right-hand operand of type 'T' (or there is no acceptable conversion)`

I don't know enough about templates and this error message doesn't help much.