24小时热门版块排行榜    

查看: 337  |  回复: 1

cean

金虫 (职业作家)

屌绳一条

[求助] template function怎么用?

CODE:
template void serializerToAsciiStream(DataSerializer const* serializer, std::ostream* ostr, plint numDigits) {     serializerToSink(serializer, new AsciiWriter(ostr, numDigits)); }

程序里调用如下:

    plint numDigits=8;
    serializerToAsciiStream(serializer, ostr, numDigits);
其中 DataSerializer const* serializer, std::string const& name

但编译错误:
/home/peter/x.hh: In member function ‘void plb::GMSHDataWriter3D::writeDataField(const plb:ataSerializer*, const std::string&, plb::plint)’:
/home/peter/x.hh:86: error: no matching function for call to ‘serializerToAsciiStream(const plb:ataSerializer*&, std:fstream*&, plb::plint&

怎么不匹配 ?


先谢了。

[ Last edited by cean on 2011-11-6 at 20:02 ]
回复此楼

» 收录本帖的淘帖专辑推荐

fortran 原子距离

» 猜你喜欢

To do great work, you have to have a pure mind.
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cean

金虫 (职业作家)

屌绳一条


dubo(金币+1): 欢迎讨论 2011-11-07 18:02:20
中间加了可以了。
如下:
serializerToAsciiStream(serializer, ostr, numDigits);
To do great work, you have to have a pure mind.
2楼2011-11-07 17:04:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 cean 的主题更新
信息提示
请填处理意见