C++ 迁移到VS2010时使用std::stringstream时出现错误C2678

C++ 迁移到VS2010时使用std::stringstream时出现错误C2678,c++,visual-studio-2010,stringstream,visual-c++-2010,C++,Visual Studio 2010,Stringstream,Visual C++ 2010,以下是我在VS2005中运行良好的代码: template <typename T> void _get(const PTree & p, T & value) const { std::stringstream s(p._value); s >> value; } 我能做些什么来解决这个问题 编辑: 下面是深层次错误: while trying to match the argument list '(std::stringstream

以下是我在VS2005中运行良好的代码:

template <typename T> void _get(const PTree & p, T & value) const
{
    std::stringstream s(p._value);
    s >> value;
}
我能做些什么来解决这个问题

编辑: 下面是深层次错误:

while trying to match the argument list '(std::stringstream, btVector3)'
ptree.h(162) 
: see reference to function template instantiation 'void PTree::_get<T>(const PTree &,T &) const' being compiled
with
[
    T=btVector3
]
errorfile.cpp(240)
: see reference to function template instantiation 'bool PTree::get<btVector3>(const std::string &,T &) const' being compiled
with
[
    T=btVector3
]
试图匹配参数列表(std::stringstream,btVector3)时 ptree.h(162) :请参阅正在编译的函数模板实例化“void PTree::_get(const PTree&,T&)const” 具有 [ T=btVector3 ] errorfile.cpp(240) :请参阅正在编译的函数模板实例化“bool PTree::get(const std::string&,T&)const”的参考 具有 [ T=btVector3 ]
什么是模板参数
T
?取决于,可以是float、integer、string……完整的编译器错误消息应该是这样的。是的,对于哪种特定类型,您会遇到此错误<代码>运算符>>接受stringstream且丢失的特定类型似乎是btVector3:
while trying to match the argument list '(std::stringstream, btVector3)'
ptree.h(162) 
: see reference to function template instantiation 'void PTree::_get<T>(const PTree &,T &) const' being compiled
with
[
    T=btVector3
]
errorfile.cpp(240)
: see reference to function template instantiation 'bool PTree::get<btVector3>(const std::string &,T &) const' being compiled
with
[
    T=btVector3
]