24小时热门版块排行榜    

查看: 367  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料专业求调剂 +3 hanamiko 2026-03-18 3/150 2026-03-18 16:30 by 30660438
[考研] 一志愿武理材料305分求调剂 +3 想上岸的鲤鱼 2026-03-18 4/200 2026-03-18 14:33 by laoshidan
[考研] 299求调剂 +5 △小透明* 2026-03-17 5/250 2026-03-18 11:49 by 尽舜尧1
[考研] 301求调剂 +9 yy要上岸呀 2026-03-17 9/450 2026-03-18 08:58 by 无际的草原
[考研] 材料与化工求调剂 +6 为学666 2026-03-16 6/300 2026-03-17 20:15 by peike
[考研] 277调剂 +5 自由煎饼果子 2026-03-16 6/300 2026-03-17 19:26 by 李leezz
[考研] 268求调剂 +8 一定有学上- 2026-03-14 9/450 2026-03-17 17:47 by laoshidan
[考研] 302求调剂 +9 负心者当诛 2026-03-11 9/450 2026-03-17 17:13 by ruiyingmiao
[考研] 【0856】化学工程(085602)313 分,本科学科评估A类院校化学工程与工艺,诚求调剂 +7 小刘快快上岸 2026-03-11 8/400 2026-03-17 16:57 by ruiyingmiao
[考研] 一志愿南京大学,080500材料科学与工程,调剂 +4 Jy? 2026-03-16 4/200 2026-03-17 11:02 by gaoqiong
[考研] 一志愿,福州大学材料专硕339分求调剂 +3 木子momo青争 2026-03-15 3/150 2026-03-17 07:52 by laoshidan
[考研] 11408 一志愿西电,277分求调剂 +3 zhouzhen654 2026-03-16 3/150 2026-03-17 07:03 by laoshidan
[考研] 318求调剂 +3 Yanyali 2026-03-15 3/150 2026-03-16 16:41 by houyaoxu
[考研] 求老师收留调剂 +4 jiang姜66 2026-03-14 5/250 2026-03-15 20:11 by Winj1e
[考研] 281求调剂 +9 Koxui 2026-03-12 11/550 2026-03-13 20:50 by Koxui
[考研] 一志愿211化学学硕310分求调剂 +8 努力奋斗112 2026-03-12 9/450 2026-03-13 15:41 by JourneyLucky
[考研] 求调剂 +3 程雨杭 2026-03-12 3/150 2026-03-13 15:06 by JourneyLucky
[考研] 一志愿山大07化学 332分 四六级已过 本科山东双非 求调剂! +3 不想理你 2026-03-12 3/150 2026-03-13 14:18 by JourneyLucky
[考研] 277求调剂 +4 anchor17 2026-03-12 4/200 2026-03-13 11:15 by 白夜悠长
[考研] 321求调剂(食品/专硕) +3 xc321 2026-03-12 6/300 2026-03-13 08:45 by xc321
信息提示
请填处理意见