I have this template function that gets an element from an `std::map` as a string, converts it to generic `T` through `std::stringstream operator>>` and returns it.

However the extraction operator only extracts the first word in the stream.

I have tried `.str()`, but for a template function it won't do. I have also tried `ss >> std::noskipws >> result;` but it does not seem to return valid data.

```cpp
template<typename T>
T CConfig::get(const char *setting)
{
    std::stringstream ss;
    ss << this->m_settings[setting];
    // this->m_settings[setting] = "this is a test"

    T result;
    ss >> result;
    // result = "this"

    return result;
}

```

My expectation is that if m\_settings[setting] is `"this is a test"`, the same string will be returned in my `get` function. And at the same time, I don't want to break the template by hardcoding `ss.str()` and using a different function for strings.