Wikibooks zhwikibooks https://zh.wikibooks.org/wiki/Wikibooks:%E9%A6%96%E9%A1%B5 MediaWiki 1.47.0-wmf.8 first-letter Media Special Talk User User talk Wikibooks Wikibooks talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Transwiki Transwiki talk Wikijunior Wikijunior talk Subject Subject talk TimedText TimedText talk Module Module talk Event Event talk Wikibooks:互助客棧 4 107 186042 186041 2026-06-25T13:30:44Z MediaWiki message delivery 28238 /* Deployment of Legal and Safety Contacts Link in the Footer of Your Wiki */ 新章节 186042 wikitext text/x-wiki {{DISPLAYTITLE|互助客棧}} {{/header}} == 再谈改名建议 == 十年前曾有[[Wikibooks:互助客栈/存档/二零一二年#教科书易名建议|一次讨论]]开启了该议题之先河,但无下文,个人觉得本网站参与和活跃程度低,跟教科书这个名字的限定有很大关系。纵观方针所限定可以收录的内容和其他语言版本里实际收录的东西,都远不止教科书那么狭窄,所以再次呼吁改名。--[[User:虹色分子|虹色分子]] ([[User talk:虹色分子|留言]]) 2022年11月4日 (五) 12:32 (UTC) :{{支持}} --[[User:SugaryMegmin|<span style="font-family:宋体;font-size:18px;color:green">'''酥糖'''</span>]] [[User_talk:SugaryMegmin|<span style="font-family:Times New Roman;font-size:18px;color:grey">''Megmin''</span>]] 2022年11月7日 (一) 05:30 (UTC) :{{补充}}就网站现状来说,这个站点有点“芜草丛生”,需要改进的部分还很多,我会列表出来供有志参与的编辑者参考。--[[User:SugaryMegmin|<span style="font-family:宋体;font-size:18px;color:green">'''酥糖'''</span>]] [[User_talk:SugaryMegmin|<span style="font-family:Times New Roman;font-size:18px;color:grey">''Megmin''</span>]] 2022年11月7日 (一) 05:34 (UTC) :{{支持}} '''《維基課本》'''--[[User:Btooombtooom|Btooombtooom]] ([[User talk:Btooombtooom|留言]]) 2022年11月24日 (四) 11:21 (UTC) ::{{意見}}:《課本》不太好,☆疾風。肯尼★_君所言甚是,《課本》一名不太吸引小朋友,甚至可能會有退避三舍的感覺。 --<span style="color:red;font-family:新一細明體">勿用[[w:歐化中文#濫用抽象動詞|「進行」污染中文]],要言簡意賅。</span> [[User:捍粵者|<span style="color:#007F00;font-family:新一細明體">'''捍粵者'''</span>]] 2023年5月7日 (日) 15:58 (UTC) : 似乎應該考慮與維基文庫之間的聯繫。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2023年2月28日 (二) 05:18 (UTC) :誠如{{ping2|Jusjih}}君所言,{{支持}}《維基書屋》。--<span style="color:red;font-family:新一細明體">勿用[[w:歐化中文#濫用抽象動詞|「進行」污染中文]],要言簡意賅。</span> [[User:捍粵者|<span style="color:#007F00;font-family:新一細明體">'''捍粵者'''</span>]] 2023年5月7日 (日) 15:53 (UTC) ::维基书房似乎亦可。&nbsp;——[[User:魔琴|<span style="color:#080;font-size:120%;font-family:cursive">魔琴</span>]] <small>[&nbsp;[[User talk:魔琴|留言]] [[Special:Contribs/魔琴|贡献]]&nbsp;]</small> 2023年11月7日 (二) 12:11 (UTC) :支持改为教科书以外的名字 -<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<font color="#6495ED">及时雨</font>]] [[User talk:94rain|<sup><font color="gold">'''Talk'''</font></sup>]] </span> 2023年11月26日 (日) 22:06 (UTC) ::{{补充}} 个人建议维基读本。”教科书“会导致有用户从真的教科书搬内容过来。 <span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<font color="#6495ED">及时雨</font>]] [[User talk:94rain|<sup><font color="gold">'''Talk'''</font></sup>]] </span> 2024年1月20日 (六) 21:12 (UTC) :::支持讀本吧,或者書本之類的,看起來改名各位都基本同意,具體改成啥名先求個共識或者投票吧。 [[User:Rowe Wilson Frederisk Holme|Rowe Wilson Frederisk Holme]] ([[User talk:Rowe Wilson Frederisk Holme|留言]]) 2024年1月31日 (三) 08:08 (UTC) ::::维基图书 [[User:Midleading|Midleading]] ([[User talk:Midleading|留言]]) 2024年2月5日 (一) 07:03 (UTC) :::::图书的话感觉容易和维基文库分不清 <span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<font color="#6495ED">及时雨</font>]] [[User talk:94rain|<sup><font color="gold">'''Talk'''</font></sup>]] </span> 2024年2月5日 (一) 07:15 (UTC) ::::::{{支持}}「维基读本」ㄧ📒[[User:78-Yellowcat|'''<span style="color:#ffd700">78Cat</span>''']]📚 • [[User talk:78-Yellowcat|📮]] 2024年2月7日 (三) 08:44 (UTC) :::::::我一直以来就以为wikibooks叫做维基图书。我觉得要改名的话,维基读本、维基教科书都不如维基图书。因为图书并不偏向于fiction和nonfiction的任何一方,他全部包括。而读本,至少在我的语言习惯里面(我是北方人)比较偏向于虚构文学,小说之类的,尤其偏向表示小孩子阅读的书籍。比如任何我上学使用的教科书,我会认为它们是图书,但一般不会认为它们是读本。各种偏实用性质的教程,就更和读本谈不上关系。[[User_talk:Bluedeck|<span style="font:83% Times;line-height:1em;border-radius:9em;padding:0 4em;box-shadow:0 2px 9px #ace;background:linear-gradient(40deg,#396cdb,#2c58cc 60%,#39f 60%,#4dbeff 75%,#3df 75%,#3cf);color:#fff" lang="en">Bluedeck</span>]] 2024年5月2日 (四) 05:16 (UTC) ::::::::“图书”的话会和文库混淆,就直接叫“维基教程”就行 [[User:Dnaimfz|Dnaimfz]] ([[User talk:Dnaimfz|留言]]) 2024年5月11日 (六) 11:09 (UTC) :::::::::看不出为何会有混淆,你是个已经被封禁的纯粹破坏用户。 [[User:Midleading|Midleading]] ([[User talk:Midleading|留言]]) 2024年9月7日 (六) 08:18 (UTC) :::::::::{{意见}} {{补充}} 维基媒体基金会的命名是将wiki与原有的英文单词拼接,我认为英文wikibook其实是wiki+textbook的变化,所以中文译文并无不妥。但是我认为根据维基百科[1]教科书的词条,“教科書或課本即是學校指定最官方的讀本書籍,它根據學校課程內容編寫,也用來泛指有關學校課程的書籍。” 所以并不适合与一个在网络上可以自由编辑的平台的名称。 ::::::::[[User:Joyance-Tsui|Joyance-Tsui]] ([[User talk:Joyance-Tsui|留言]]) 2024年12月9日 (一) 13:27 (UTC) ::{{支持}},因為中文wikibooks不能收錄電子遊戲攻略的原因就是因為wikibooks的中文名稱是維基教科書,英文wikibooks與日文wikibooks均已收錄電子遊戲攻略,因為英文books確實包含電子遊戲攻略,而中文教科書則不包含電子遊戲攻略,我覺得這完全是歧視以中文為母語的人(包括中國大陸人與台灣人以及香港人,還有部份的新加坡人與馬來西亞人,馬來西亞是有許多語言的地區,包括英文、中文以及馬來語),所以強烈建議wikibooks的中文名稱修改成一個可以收錄電子遊戲攻略的名稱,與英文wikibooks與日文wikibooks一樣。 [[Special:Contributions/118.170.40.46|118.170.40.46]] ([[User talk:118.170.40.46|留言]]) 2024年3月15日 (五) 06:52 (UTC) : 另外還要確定若正式更名,有什麼其他地方需要對應更改?跨維基站點內容也不少。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2024年2月4日 (日) 17:58 (UTC) ::这个不急,先定下来再说,可以慢慢改,曾用名暂时留着也不会有大问题 <span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<font color="#6495ED">及时雨</font>]] [[User talk:94rain|<sup><font color="gold">'''Talk'''</font></sup>]] </span> 2024年2月7日 (三) 08:57 (UTC) :{{支持}}感觉叫“维基教程”不错 [[User:Dnaimfz|Dnaimfz]] ([[User talk:Dnaimfz|留言]]) 2024年5月11日 (六) 11:06 (UTC) :{{支持}}維基圖書、維基書房、維基書屋與維基書籍。--[[User:S8321414|S8321414]] ([[User talk:S8321414|留言]]) 2024年6月3日 (一) 05:52 (UTC) ::不推荐使用维基书房、维基书屋,因为书房和书屋都和维基文库的文库、图书馆是近义词,而维基图书的图书含义包括现在的教科书,和维基文库的图书馆不是近义词。 [[User:Midleading|Midleading]] ([[User talk:Midleading|留言]]) 2024年9月15日 (日) 10:54 (UTC) :建议转交到维基百科,这样才能有更多人关注。 [[User:Crystallus0|Crystallus0]] ([[User talk:Crystallus0|留言]]) 2024年6月6日 (四) 13:59 (UTC) :{{支持}}。我建议改为维基图书。 Pawsdt [[User:Pawsdt|U]] [[User Talk:Pawsdt|T]] [[Special:Contributions/Pawsdt|C]][+8] 2026年5月26日 (二) 12:05 (UTC) ---- {{ping|水水|Wong128hk|Jusjih|Kayau|Shizhao|Ntudreamer|C933103|Guoyunhe}}再提及多一些人參與討論(主要是當年討論有份者),便於凝聚共識。我個人是認為已有更名共識,僅在具體命名方面尚有分歧。最終可能需要付諸投票,以取得確定結論?—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2024年9月14日 (六) 15:26 (UTC) : {{ping|Ntudreamer|C933103|Guoyunhe}}(補提及;沒想到本站模板久未更新,上限仍是五位)—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2024年9月14日 (六) 15:27 (UTC) :如果不執着對原文翻譯的話,維基教程 or 維基教學 感覺上都能傳遞到這網站的收錄範圍並不限於學術內容的意思。 [[User:C933103|C933103]] ([[User talk:C933103|留言]]) 2024年9月16日 (一) 09:45 (UTC) ::不建议用维基教程和维基教学,[[v:|维基学院]]才是自由研习社群。 [[User:Midleading|Midleading]] ([[User talk:Midleading|留言]]) 2024年9月19日 (四) 08:03 (UTC) :認同已有更名共識。至於新名選項建議篩選一下,然後再付諸表決。 [[user:Wong128hk|'''J.W''']][[user_talk:Wong128hk|'''ong''']] 2024年10月27日 (日) 05:07 (UTC) :'''(+)支持''' --根据维基百科[https://zh.wikipedia.org/wiki/%E6%95%99%E7%A7%91%E6%9B%B8]教科书的词条,“'''教科書'''或'''課本'''即是[[w:學校|學校]]指定最官方的讀本[[w:書籍|書籍]],它根據學校[[w:課程|課程]]內容編寫,也用來泛指有關學校課程的書籍。” 所以并不适合与一个在网络上可以自由编辑的平台的名称。 [[User:Joyance-Tsui|Joyance-Tsui]] ([[User talk:Joyance-Tsui|留言]]) 2024年12月9日 (一) 13:21 (UTC) :回Midleading,书房和文库、图书馆到底有什麼联繫? &nbsp;——[[User:魔琴|<span style="color:#080;font-size:120%;font-family:cursive">魔琴</span>]] <small>[&nbsp;[[User talk:魔琴|留言]] [[Special:Contribs/魔琴|贡献]]&nbsp;]</small> 2025年8月10日 (日) 15:18 (UTC) :: {{ping2|Midleading}}。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2025年8月11日 (一) 17:25 (UTC) ::和教科书、图书对比,书房、文库、图书馆都是藏书的位置,而教科书、图书都是书而非位置。这里可以参考其他姊妹项目的名称,维基百科是要共建一部百科全书,维基文库是要共建一个图书馆,维基语录是要共建一部语录,维基词典是要共建一部词典,等等。维基教科书要共建的应该是教科书,或者是课本、图书,而不是建设一个图书馆。书房的表述比较模糊,但更像是图书馆中的一个房间,而不用于代表所藏的书。读本这个词通常不是出现在低龄段教育中,就是出现在文学和哲学研究中,特别是两者互相交叉时(如教科书《习近平新时代中国特色社会主义思想学生读本》)。不同背景的读者对“读本”一词会有不一致的理解,所以也不适合作为新名称。 [[User:Midleading|Midleading]] ([[User talk:Midleading|留言]]) 2025年8月12日 (二) 03:19 (UTC) :{{意见}} 可是维基教科书的主要收录内容不就是编写的各教学类书籍吗,至于前文所述的电子游戏攻略,叫教科书之类也无不可。如果改名,本人倾向支持维基书屋的名字,个人感觉读起来十分通顺舒适,也便于记忆宣传,但确实会让人觉得这里可能是收录了很多已出版图书,类似维基文库的感觉。 ~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月11日 (一) 03:56 (UTC) ::引自[[维基教科书:维基教科书是什么]](当然,并不是正式方针):''“简单来说,维基教科书是一部内容开放的教科书书集。”“一般来说,只有教学图书适合被收录。大多数类型的图书(包括小说及非小说类文学作品)除非有教学意义,否则是不被维基教科书所收录的。”''显然不能当作书屋,如果不考虑开设课程的话,叫维基自学还差不多。 [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月11日 (一) 04:01 (UTC) :::另回“维基读本”提议,我也是大陆北方背景,但从我的语言习惯和认知来看读本反而给我一种专业的感觉,似乎因为文学和哲学课程中经常使用这个词称呼研习材料。不过该词确实不仅限于学术,作为读者,本站内容似乎也符合读本定位。 ~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月11日 (一) 04:11 (UTC) ::::而“图书并不偏向于fiction和nonfiction的任何一方,他全部包括。”就是我个人不赞同“维基图书”这个名字的主要理由,除非你站大改收录范围、惯例和定位,那我会支持。 ~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月11日 (一) 04:13 (UTC) : 要不就「书籍」吧,反正book就是书。 &nbsp;——[[User:魔琴|<span style="color:#080;font-size:120%;font-family:cursive">魔琴</span>]] <small>[&nbsp;[[User talk:魔琴|留言]] [[Special:Contribs/魔琴|贡献]]&nbsp;]</small> 2025年10月24日 (五) 20:20 (UTC) :: 可不可以不要「籍」,會給人本站收錄文獻的感覺。也不是要折騰您,畢竟大家商量不出來名字就是因為不好取,還有文庫在旁邊。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2025年10月26日 (日) 17:19 (UTC) :{{支持}}維基書本;但活躍程度低大概和名字沒什麽關係。因爲{{tsl|en|Wikiversity:Differences between Wikiversity and Wikibooks|Wikiversity本來就是Wikibooks的子項目}},兩者都已經重疊上天了,還分爨。這在外語一樣半死不活。活躍程度低是活該的。 [[User:Gedu11539381|Gedu11539381]] ([[User talk:Gedu11539381|留言]]) 2026年5月24日 (日) 19:33 (UTC) :{{意見}}如果要改名是否要事先準備?尤其是有關頁面及分類名稱、模板內容等,有許多提及「維基教科書」,工作量較大。而且這個話題上次較活躍的日期為2024至2025年,最近沒有動態,對名稱似乎沒有共識。[[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|留言]]) 2026年6月7日 (日) 05:35 (UTC) == 批量删除User:蛇守护的苹果堆创建的页面 == [[User:蛇守护的苹果堆]][https://xtools.wmcloud.org/pages/zh.wikibooks.org/%E8%9B%87%E5%AE%88%E6%8A%A4%E7%9A%84%E8%8B%B9%E6%9E%9C%E5%A0%86 创建的页面]相当一部分侵犯版权或是缺少实际内容,且仍有[[Wikibooks:删除请求#生物化学与分子生物学]]、[[Wikibooks:删除请求#摄影技术]]等删除请求时隔多年未获处理。该用户创建的页面横跨诸多学科,结合已发现的侵权情况,可推知其余页面极大可能亦非正常撰写。现请求批量删除该用户创建的所有页面。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2025年8月15日 (五) 16:59 (UTC) :如无异议,本人将在元维基请求全域管理员协助。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2025年8月15日 (五) 17:00 (UTC) ::此人创建的上千页面中有很多空页面,何以见得侵权?不过没有内容,按照方针应当怎样处理呢? ~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月16日 (六) 03:08 (UTC) :::这些长期未有改善、在可预见的将来也不会改善的页面应当删除。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2025年8月16日 (六) 05:31 (UTC) ::::我支持你的判断和想法。 ~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2025年8月16日 (六) 07:24 (UTC) ::按[[:meta:Global sysops/Requests]]的说明,这类复杂的删除请求应在[[:meta:Steward requests/Miscellaneous]]提出,由监管员处理。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2025年8月17日 (日) 01:07 (UTC) : {{ping|沈澄心}}是否應先列出所有受影響頁面?—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2025年9月2日 (二) 07:34 (UTC) ::@[[User:Ericliu1912|Ericliu1912]]:[https://xtools.wmcloud.org/pages/zh.wikibooks.org/%E8%9B%87%E5%AE%88%E6%8A%A4%E7%9A%84%E8%8B%B9%E6%9E%9C%E5%A0%86]。我认为不需要(也没有精力)再逐一核查。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2025年9月2日 (二) 07:39 (UTC) : (最近[[:meta:Steward requests/Miscellaneous#Batch deletion on Chinese Wikibooks|有人在催]])我現在比較有空處理了。也請諸位管理員{{ping2|Sayonzei|Shizhao|TunnelESON|WhitePhosphorus|Wong128hk}}協助。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2026年4月8日 (三) 08:37 (UTC) ::蛇守护的苹果堆已逾四年未活躍。請在[[维基教科书:删除请求]]指明要刪哪些,切勿太概括表示全刪。--[[User:TunnelESON|TunnelESON]] ([[User talk:TunnelESON|留言]]) 2026年4月18日 (六) 04:33 (UTC) ::: 我想现在可能应该反过来让作者说明这些页面是如何创作的才对。 '''<span style="font-family:Iosevka,monospace">[[User:沈澄心|<span style="color:#9f3526">dring</span>]][[User talk:沈澄心|<span style="color:#534fa3">sim</span>]]</span>''' 2026年5月24日 (日) 14:38 (UTC) ::::我没意见。~ [[User:Sheminghui.WU|Sheminghui.WU]] ([[User talk:Sheminghui.WU|留言]]) 2026年5月29日 (五) 00:36 (UTC) == 关于提交编辑上面的msgbox == 在深色模式下,字体会很浅,请求更改。<small>—以上未簽名的留言是由[[User:Pawsdt|Pawsdt]]([[User talk:Pawsdt|對話]] -{|}- [[Special:Contributions/Pawsdt|貢獻]]){{#if:2026年3月17日 (二) 16:44 (UTC)|於2026年3月17日 (二) 16:44 (UTC)}}加入的。</small><!-- Template:Unsigned --> == 防濫用過濾器3問題 == [[Special:AbuseFilter|防濫用過濾器3]]對於「禁止新用戶或頁面建立者移除刪除模板」的定義過於廣泛,以致於執行普通模板編輯時[https://zh.wikibooks.org/w/index.php?title=Special:AbuseLog&wpSearchFilter=3 被不必要的攔截]([[Special:AbuseLog/2045|範例1]]、[[Special:AbuseLog/2090|範例2]]、[[Special:AbuseLog/2248|範例3]]、[[Special:AbuseLog/2259|範例4]]),需要更改。[[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|留言]]) 2026年5月29日 (五) 10:43 (UTC) 補充:程式碼(自[[Special:AbuseFilter/3]])(<small>2026年6月5日 (五) 08:56 (UTC) 編輯</small>) <pre><nowiki>(action == "edit") & (!("confirmed" in user_groups)|(page_first_contributor == user_name)) & (removed_lines irlike "{{Dr|{{Afd|{{Vfd"|removed_lines rlike "{{Delete|{{D") & !("sysop" in user_groups) & page_prefixedtitle != "Wikibooks:沙盒"</nowiki></pre> :对的。我也出现过。{{支持}}更改。 Pawsdt [[User:Pawsdt|U]] [[User Talk:Pawsdt|T]] [[Special:Contributions/Pawsdt|C]][+8] 2026年6月1日 (一) 11:39 (UTC) ::例如第3行末尾“<nowiki>..|&#123;&#123;D"</nowiki>”似乎也会拦截尝试删除例如{{tl|Documentation}}之类开头是D的模板的编辑。 Pawsdt [[User:Pawsdt|U]] [[User Talk:Pawsdt|T]] [[Special:Contributions/Pawsdt|C]][+8] 2026年6月1日 (一) 12:17 (UTC) :::<s>這可能是因為'''D'''elete的D字母關係 [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|留言]]) 2026年6月2日 (二) 08:53 (UTC)</s> :::我发现只要涉及到含有&#123;&#123;d内容的行的更改都会被拦截。 Pawsdt [[User:Pawsdt|U]] [[User Talk:Pawsdt|T]] [[Special:Contributions/Pawsdt|C]][+8] 2026年6月4日 (四) 15:20 (UTC) :{{ping|Ericliu1912}}請求協助 [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|留言]]) 2026年6月5日 (五) 09:05 (UTC) :: {{ping|Addonian1123|Pawsdt}}你們覺得要怎麼改?—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2026年6月6日 (六) 13:05 (UTC) :::第三行<code><nowiki>removed_lines rlike "{{Delete|{{D"</nowiki></code>會匹配到所有以<code><nowiki>{{D</nowiki></code>開頭的模板,若許使用<code><nowiki>(removed_lines irlike "\{\{(dr|afd|vfd|delete|d)\s*(\||\}\})")</nowiki></code>較為適合?而且描述中對「新用戶」的定義不清楚,可能改為「非自動確認用戶」會比較好。[[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|留言]]) 2026年6月7日 (日) 05:42 (UTC) ::::{{ping|Ericliu1912| Pawsdt}}你們覺得如何?(抱歉使用ping,然而此話題已閒置許久,且編輯仍然出現問題)。 [[User:Addonian1123|<span style="color:#4BA4D1">'''Addonian1123'''</span>]] '''('''[[User talk:Addonian1123|<span style="color:#49BF66">'''討論'''</span>]]'''|'''[[w:User:Addonian1123|<span style="color:#E1E158">維基百科</span>]]''')''' 2026年6月11日 (四) 08:52 (UTC) ::::: 我已先更新代碼,有問題再說。—— '''[[User:Ericliu1912|Eric Liu]]'''<sub>('''[[User talk:Ericliu1912|留言]]''')</sub> 2026年6月11日 (四) 14:52 (UTC) ::::::{{完成}}初步測試:D開頭的模板(允許編輯)及afd模板(禁止)。無明顯問題。 [[User:Addonian1123|<span style="color:#4BA4D1">'''Addonian1123'''</span>]] '''('''[[User talk:Addonian1123|<span style="color:#49BF66">'''討論'''</span>]]'''|'''[[w:User:Addonian1123|<span style="color:#E1E158">維基百科</span>]]''')''' 2026年6月11日 (四) 16:09 (UTC) == 台灣分會2026年6月對話時間 == <div style="padding: 1.2rem 1rem; background: #f8f5ff; border: 1px solid #b29bd7; margin:1em 0; font-size: 1.08em; display: flex; align-items: center;"> <div style="flex: 1;"> <div style="font-size:x-large; padding-bottom:5px;">'''社群疑難雜症找協會!'''</div> [[m:Special:MyLanguage/Wikimedia Taiwan|台灣維基媒體協會]]2026年4月的[[m:Wikimedia Taiwan/Wikimedia Taiwan Office Time|對話時間]],訂於台灣時間'''6/26 (五) 19:00'''舉行,<br> 參與連結為 https://meet.google.com/qiv-ctih-sse 。<br> 協會到底在做什麼?如果你覺得協會存在感超低,有事都找不到人,把握這次的對話機會!這是一個定期舉辦的服務時段,由協會秘書長親自主持,有問題馬上解決。協會會分享目前進行中的專案與計劃,也邀請社群朋友分享想法、反映需求,彼此開講、一起討論。<br> 本月討論主題將討論今年的'''維基愛地球'''活動及正在進行中的'''仲裁機制調整說明會''',這是將是讓你深入了解協會運作並參與交流的絕佳機會!快來一起參加! --[[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|留言]]) 2026年6月21日 (日) 00:19 (UTC) </div> <div style="margin-left: 1rem;"> [[File:Wikimedia Taiwan.svg|160px|alt=|link=m:Special:MyLanguage/Wikimedia Taiwan]] </div> </div> <!-- 信息由 User:NHC@metawiki 发送,使用的列表为 https://meta.wikimedia.org/w/index.php?title=Wikimedia_Taiwan/Wikimedia_Taiwan_Office_Time/List&oldid=30591377 --> == RFC about AI-generated content in Wikimedia Commons == <bdi lang="en" dir="ltr">Apologies for writing in English, please help translate this message to your language. You are invited to participate in a [[c:Commons:Requests for comment/Policy update for AI content|request for comment on Wikimedia Commons about a policy update for AI content]]. This may affect files that are uploaded to Wikimedia Commons for use on this project. Thank you. [[m:User:Codename Noreste|Codename Noreste]] ([[m:User talk:Codename Noreste|留言]])</bdi> 2026年6月23日 (二) 17:11 (UTC) (该消息原计划发送至[[:Wikibooks:互助客栈]],由于该页面为重定向,现张贴于本页。) <!-- 信息由 User:Codename Noreste@metawiki 发送,使用的列表为 https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=30513860 --> : (翻譯)'''徵求有關維基共享資源中AI生成內容的意見'''<br>敬請參與維基共享資源[[c:Commons:Requests for comment/Policy update for AI content|關於調整AI內容方針的意見徵詢]]。此次調整可能會影響上傳到維基共享資源以於此專案使用的檔案,謝謝![[User:Addonian1123|<span style="color:#4BA4D1">'''Addonian1123'''</span>]] '''('''[[User talk:Addonian1123|<span style="color:#49BF66">'''討論'''</span>]]'''|'''[[w:User:Addonian1123|<span style="color:#E1E158">維基百科</span>]]''')''' 2026年6月25日 (四) 09:09 (UTC) == <span lang="en" dir="ltr">Deployment of Legal and Safety Contacts Link in the Footer of Your Wiki</span> == <div lang="en" dir="ltr"> <section begin="Message"/> '''Legal & Safety Contacts''' Hello community, the Wikimedia Foundation has provided a [[wmf:Special:MyLanguage/Legal:Wikimedia Foundation Legal and Safety Contact Information|single legal and safety contact page]], to be linked in the footer of your wiki, to ensure access to accurate legal information. This is a regulatory requirement. We have already rolled out links to English, German, Italian, Spanish and other wikis and we will deploy to your wiki soon. [[m:Special:MyLanguage/Wikimedia_Foundation_Legal_and_Safety_Contacts_FAQ|Please read more on the project page]] and leave any comments in this thread or on the [[m:Special:MyLanguage/Talk:Wikimedia Foundation Legal and Safety Contacts FAQ|talk page]]. <section end="Message"/> </div> -- [[User:Sannita (WMF)|User:Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 2026年6月25日 (四) 13:30 (UTC) (该消息原计划发送至[[:Wikibooks:互助客栈]],由于该页面为重定向,现张贴于本页。) <!-- 信息由 User:Sannita (WMF)@metawiki 发送,使用的列表为 https://meta.wikimedia.org/w/index.php?title=User:Sannita_(WMF)/Mass_sending_test&oldid=30731267 --> ksclkay1g4eblglxxangu6grnxocwv4 C++/functional 0 30338 186044 186013 2026-06-25T17:05:26Z 52-Feb 68604 /* function类模板 */ 186044 wikitext text/x-wiki functional是[[b:C++标准程式库]]中的一个[[b:头文件]],主要用于C++ STL标准中提供 “函数对象 / 可调用对象”相关的工具。它的核心用途可以概括为:把普通函数、成员函数、lambda、函数对象等统一当作“可调用对象”来保存、传递、包装、绑定和调用。 ==命名空间placeholders== 定义了用作 std::bind 表达式中的未绑定实参的占位符常量:_1, _2, _3, _4, ... ==类== ===function类模板=== std::function 是一个通用函数包装器,可以保存任何签名(signature)兼容的可调用对象。 必要性:如果lambda表达式赋值给一个函数指针,则编译报错。这就需要一个能保存各种可调用类型对象的办法。实际上,lambda表达式有可能捕获外部对象及其值做成闭包,因此每个lambda表达式都是独一无二的类型。 std::function是一个可变参类模板,是一个通用的函数包装器(Polymorphic function wrapper)。std::function的实例可以存储、复制和调用任何可复制构造的可调用目标,包括普通函数、成员函数、类对象(重载了operator()的类的对象)、lambda表达式等。是对C++现有的可调用实体的一种类型安全的包裹(相比而言,函数指针这种可调用实体,是类型不安全的)。 std::function中存储的可调用对象被称之为std::function的目标。若std::function中不含目标,调用不含目标的std::function会抛出std::bad_function_call 异常。 <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> // 定义一个类,用function包裹其成员 struct Foo { Foo(int num) : num_(num) {} void print_add(int i) const { std::cout << num_+i << '\n'; } int num_; }; // 定义一个普通函数,用function进行包裹 void print_num(int i) { std::cout << i << '\n'; } // 定义一个重载了operator()的类,function可以包裹其对象 struct PrintNum { void operator()(int i) const { std::cout << i << '\n'; } }; int main() { // 存储自由函数 std::function<void(int)> f_display = print_num; f_display(-9); // 存储 lambda std::function<void()> f_display_42 = []() { print_num(42); }; f_display_42(); // 存储到 std::bind 调用的结果 std::function<void()> f_display_31337 = std::bind(print_num, 31337); f_display_31337(); // 存储到成员函数的调用,第一个入参为this指针 std::function<void(const Foo&, int)> f_add_display = &Foo::print_add; const Foo foo(314159); // 第一个入参为this指针 f_add_display(foo, 1); f_add_display(314159, 1); // 存储到数据成员访问器的调用 std::function<int(Foo const&)> f_num = &Foo::num_; std::cout << "num_: " << f_num(foo) << '\n'; // 存储到成员函数及对象的调用 using std::placeholders::_1; std::function<void(int)> f_add_display2 = std::bind( &Foo::print_add, foo, _1 ); f_add_display2(2); // 存储到成员函数和对象指针的调用 std::function<void(int)> f_add_display3 = std::bind( &Foo::print_add, &foo, _1 ); f_add_display3(3); // 存储到函数对象的调用 std::function<void(int)> f_display_obj = PrintNum(); f_display_obj(18); auto factorial = [](int n) { // 存储 lambda 对象以模拟“递归 lambda ”,注意额外开销 std::function<int(int)> fac = [&](int n){ return (n < 2) ? 1 : n*fac(n-1); }; // note that "auto fac = [&](int n){...};" does not work in recursive calls return fac(n); }; for (int i{5}; i != 8; ++i) { std::cout << i << "! = " << factorial(i) << "; "; } } </syntaxhighlight> <code>std::function</code>底层核心原理:针对每一种可调用类型,标准库都会生成一套专属封装子类<code>callable</code>,子类内部存储原可调用对象、并实现调用逻辑;所有封装子类公有继承同一个抽象基类接口<code>callable_base</code>,外层<code>std::function</code>仅持有该基类指针。 强制标准:若待存储的可调用对象是普通函数指针或std::reference_wrapper引用包装器,std::function实现禁止额外堆内存分配。 各编译器 SBO 缓冲区大小(64 位平台): * GCC / Clang:16 字节 * MSVC:32 字节 ==== MSVC的std::function实现==== MSVC的<code>std::function</code>底层依然基于虚表多态实现[[类型擦除]],但做了两大关键工程优化: * 内置32字节栈内小对象缓冲区SBO(64位环境),优先无堆分配; * 用union复用内存:小对象直接存缓冲区,大对象存堆指针; 严格遵循标准强制规则: * 函数指针/<code>reference_wrapper</code>永远不走堆、构造<code>noexcept</code>; * 完整值语义:拷贝深克隆内部可调用实体,移动仅转移资源、无新分配。 64位下<code>sizeof(std::function<void()>) == 40</code>,构成: * 8字节:虚表指针_Vtable(类型擦除调度入口) * 32字节:SBO 栈内缓冲区联合体 _Storage 合计40字节,固定尺寸,和标准要求一致。 类型擦除后的抽象统一接口虚基类<code>_Func_base</code>。所有被包装可调用对象统一继承该抽象基类,仅暴露 4 个虚函数: <syntaxhighlight lang="cpp"> struct _Func_base { virtual ~_Func_base() noexcept = default; // 执行调用 virtual auto _Invoke(...) const -> Ret = 0; // 克隆一份内部可调用(拷贝构造用,返回堆上新base) virtual _Func_base* _Clone() const = 0; // 判断是否为空目标 virtual bool _Empty() const noexcept = 0; // 自定义分配器支持的克隆(带Allocator) virtual _Func_base* _Clone_alloc(_Alloc&) const = 0; }; </syntaxhighlight> 所有动态分发(调用、拷贝、判空)全部走这套虚函数接口,对外彻底抹除底层可调用类型 F,即类型擦除。 _Func_impl<F, Alloc>:保存,并实现虚函数 模板派生封装类 <code>_Func_impl<F, Alloc, R, Args...></code>对每一种传入的可调用类型 F,编译器实例化一份独立派生类:内部直接持有完整的、具体 callable对象F;实现调用、拷贝、判空、分配器等全部4个虚函数:把调用操作转发给底层F;<code>_Clone()</code>新建堆上<code>_Func_impl<F></code>,完成深拷贝;若传入自定义分配器,使用传入 <code>Alloc</code> 完成堆内存分配 / 释放。 <code>std::function<R(Args...)></code>:对外的值语义包装器 / facade 这种三层_Base / _Impl / _Manager class结构,是很常见的Type Erasure设计模式,或者称Concept-Model-Wrapper Idiom。 ===mem_fn函数模板=== 从成员指针创建出函数对象。对数据成员指针也适用。与bind函数模板的区别是,mem_fn只关注、包装了类成员指针,而bind需要指明参数。例如: <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> struct Foo { void display_greeting() { std::cout << "Hello, world.\n"; } void display_number(int i) { std::cout << "number: " << i << '\n'; } int data = 7; }; int main() { Foo f; auto greet = std::mem_fn(&Foo::display_greeting); greet(&f); auto print_num = std::mem_fn(&Foo::display_number); print_num(&f, 42); auto access_data = std::mem_fn(&Foo::data); std::cout << "data: " << access_data(&f) << '\n'; } </syntaxhighlight> ===bad_function_call类=== 调用空的 std::function 时抛出的异常 ===is_bind_expression类模板=== 若类型T是调用 std::bind 产生的类型,则此模板从 std::true_type 导出。对于任何其他类型,此模板从 std::false_type 导出。 ===is_placeholder类模板=== 若类型T是标准占位符_1 、 _2 、 _3、……的类型,则此模板分别派生自std::integral_constant<int,1> 、 std::integral_constant<int,2> 、 std::integral_constant<int,3> 等。 若类型T不是标准占位符类型,则此模板派生自std::integral_constant<int,0>。 实际上,bind函数模板用is_placeholder来确定是第几个参数的占位符。 ===reference_wrapper类模板=== 可复制构造 (Copy Constructible) 且可复制赋值 (Copy Assignable) 的引用包装器(引用的容器,引用代理类模板)。内部实现,有一个数据类型的指针成员变量,在需要数据类型引用时返回相应的解引用。 配套快捷工厂函数: * std::ref(x) → reference_wrapper<T>(普通左值引用) * std::cref(x) → reference_wrapper<const T>(常量引用) 核心痛点(普通引用 T& 的缺陷),普通引用不能拷贝、不能赋值; * STL 容器(vector/list)不允许存放 T&; * <code>std::bind</code>、<code>std::thread</code>、<code>std::function</code> 默认会拷贝参数,直接传变量会复制,无法实现引用传递。 reference_wrapper核心特性: * 可拷贝、可赋值 <syntaxhighlight lang="cpp"> int a = 10; std::reference_wrapper<int> r1 = a; std::reference_wrapper<int> r2 = r1; // 允许拷贝 </syntaxhighlight> *隐式转换为 T&,可以直接传给接收 T& 的函数,无需手动解包: <syntaxhighlight lang="cpp"> void func(int& x) { x *= 2; } int n = 5; auto r = std::ref(n); func(r); // 自动转 int&,n 变成 10 </syntaxhighlight> * 获取原对象 .get() <syntaxhighlight lang="cpp"> int val = r.get(); r.get() = 99; // 修改原变量 </syntaxhighlight> * 可调用:包装函数时支持 operator() <syntaxhighlight lang="cpp"> void foo() {} auto fwrap = std::ref(foo); fwrap(); // 等价 foo() </syntaxhighlight> * 不延长生命周期:仅存指针,若原对象销毁,包装器会产生悬空引用,和裸指针风险一致。 使用场景1:容器里存放 “引用”(vector 不能存 T&) <syntaxhighlight lang="cpp"> #include <vector> #include <functional> #include <iostream> int main() { int a = 1, b = 2, c = 3; std::vector<std::reference_wrapper<int>> vec{std::ref(a), std::ref(b), std::ref(c)}; for (auto r : vec) { r.get() *= 10; } std::cout << a << " " << b << " " << c; // 10 20 30 return 0; } </syntaxhighlight> 使用场景 2:<code>std::bind</code> /<code>std::function</code> 传递引用(最常用),<code>bind</code> 默认拷贝参数,不加 <code>std::ref</code> 只会复制副本,外部修改无法同步: <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> void add(int& x, int y) { x += y; } int main() { int num = 10; // 错误:拷贝 num,内部修改不影响外部 auto bad = std::bind(add, num, 5); bad(); std::cout << num << "\n"; // 10 // 正确:reference_wrapper 传递真实引用 auto good = std::bind(add, std::ref(num), 5); good(); std::cout << num << "\n"; // 15 return 0; } </syntaxhighlight> 使用场景 3:<code>std::thread</code>线程传参避免拷贝,<code>thread</code>构造参数一律拷贝,大量数据用<code>std::ref</code>减少复制开销: <syntaxhighlight lang="cpp"> #include <thread> #include <functional> #include <iostream> void work(std::string& s) { s += " done"; } int main() { std::string msg = "task"; std::thread t(work, std::ref(msg)); t.join(); std::cout << msg; // task done return 0; } </syntaxhighlight> ===hash类模板=== template< class Key > struct hash; 允许的特化模板类是“函数对象”,实现了哈希函数。即定义了<code>operator() const</code>,接受一个Key类型的参数,返回<code>size_t</code>的哈希结果值。对于一个类型,相同值具有相同的哈希结果,不同值具有不同的哈希结果(受限于<code>size_t</code>的值域)。该类别用于4种无序关联容器(哈希容器),不适用于加密算法。 各种基础类型、大多数标准库的类型(如<code>std::string</code>)已经特化实现了hash类模板。但对于<code>std::pair</code>,需要用<code>boost::hash</code> 对自定义的类实现hash功能,有两种办法: <syntaxhighlight lang="cpp"> #include <cstddef> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <unordered_set> struct S { std::string first_name; std::string last_name; bool operator==(const S&) const = default; // since C++20 }; // Before C++20. // bool operator==(const S& lhs, const S& rhs) // { // return lhs.first_name == rhs.first_name && lhs.last_name == rhs.last_name; // } // Custom hash can be a standalone function object. struct MyHash { std::size_t operator()(const S& s) const noexcept { std::size_t h1 = std::hash<std::string>{}(s.first_name); std::size_t h2 = std::hash<std::string>{}(s.last_name); return h1 ^ (h2 << 1); // or use boost::hash_combine } }; // Custom specialization of std::hash can be injected in namespace std. template<> struct std::hash<S> { std::size_t operator()(const S& s) const noexcept { std::size_t h1 = std::hash<std::string>{}(s.first_name); std::size_t h2 = std::hash<std::string>{}(s.last_name); return h1 ^ (h2 << 1); // or use boost::hash_combine: // std::size_t seed = 0; // boost::hash_combine(seed, s.first_name); // boost::hash_combine(seed, s.last_name); } }; //推荐用法 template <class T> class A { T x; public: A(T x) : x(x) {} bool operator==(A const& b) { return x == b.x; } //可定义为成员或普通函数 //std::size_t hash_value() { return boost::hash<T>()(x); } //error不能定义为类成员函数 friend std::size_t hash_value(const A<T>& a) { return boost::hash<T>{}(a.x); } }; //备选用法-编译器若不支持模板friend(不支持 ADL 的编译器) // (不能声明为friend hash_value)hash_value需要在boost命名空间中定义 template <class T> class A1 { T x; public: A1(T x) : x(x) {} bool operator==(A1 const& b) { return x == b.x; }//可定义为成员或普通函数 std::size_t hash() const {return boost::hash<T>{}(x); } }; template <class T>std::size_t hash_value(A1<T> x){return x.hash();} int main() { std::string str = "Meet the new boss..."; std::size_t str_hash = std::hash<std::string>{}(str); std::cout << "hash(" << std::quoted(str) << ") =\t" << str_hash << '\n'; S obj = {"Hubert", "Farnsworth"}; // Using the standalone function object. std::cout << "hash(" << std::quoted(obj.first_name) << ", " << std::quoted(obj.last_name) << ") =\t" << MyHash{}(obj) << " (using MyHash) or\n\t\t\t\t" << std::hash<S>{}(obj) << " (using injected specialization)\n"; // Custom hash makes it possible to use custom types in unordered containers. // The example will use the injected std::hash<S> specialization above, // to use MyHash instead, pass it as a second template argument. std::unordered_set<S> names = {obj, {"Bender", "Rodriguez"}, {"Turanga", "Leela"}}; for (auto const& s: names) std::cout << std::quoted(s.first_name) << ' ' << std::quoted(s.last_name) << '\n'; } </syntaxhighlight> ==函数== ===bind函数模板=== std::bind 用来把函数的一部分参数提前绑定,生成一个新的可调用对象。 <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> int add(int a, int b) { return a + b; } int main() { //把 add 的第一个参数固定为 10,第二个参数留给以后传入: auto add10 = std::bind(add, 10, std::placeholders::_1); std::cout << add10(5) << std::endl; // 15 } </syntaxhighlight> 现代 C++ 中更推荐lambda代替std::bind,更为清晰、更直观、类型推导更清楚、错误信息更友好、可读性更高。例如: <syntaxhighlight lang="cpp"> auto add10 = [](int x) { return add(10, x); }; </syntaxhighlight> ===ref与cref函数模板=== 创建具有从其实参推导的类型的 std::reference_wrapper ===invoke函数模板=== (C++17)以给定实参调用任意可调用 (Callable) 对象 ==函数对象== <functional> 中定义了很多标准函数对象类模板 ===算术运算类模板=== * std::plus * std::minus * std::multiplies * std::divides * std::modulus * std::negate 例如: <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> int main() { std::plus<int> add; std::cout << add(2, 3) << std::endl; // 5 } </syntaxhighlight> ===比较运算类模板=== * std::equal_to * std::not_equal_to * std::greater * std::less * std::greater_equal * std::less_equal 例如定义大根堆/小根堆: <syntaxhighlight lang="cpp"> #include <queue> #include <vector> #include <functional> std::priority_queue<int, std::vector<int>, std::less<int>> maxHeap; std::priority_queue<int, std::vector<int>, std::greater<int>> minHeap; </syntaxhighlight> ===与C++20 ranges 体系中的受concepts约束的比较函数对象=== * ranges::equal_to类 * ranges::not_equal_to类 * ranges::greater类 * ranges::less类 * ranges::greater_equal类 * ranges::less_equal类 std::ranges::equal_to 更严格、更“概念化”,要求参与比较的类型满足equality_comparable_with这个concept约束;而std::equal_to<> 更传统、更宽松,基本上只要 a == b 表达式可用就可以。 {| class="wikitable" |+ <code>std::equal_to</code>和<code>std::ranges::equal_to</code>比较为例 ! 项目 ! <code>std::equal_to</code> ! <code>std::ranges::equal_to</code> |- | 所属头文件 | <code>&lt;functional&gt;</code> | <code>&lt;functional&gt;</code> |- | 所属命名空间 | <code>std</code> | <code>std::ranges</code> |- | 出现时间 | C++98;<code>std::equal_to&lt;&gt;</code> 透明版本为 C++14 | C++20 |- | 是否模板 | 是。常见形式为 <code>std::equal_to&lt;T&gt;</code> 或 <code>std::equal_to&lt;&gt;</code>(透明版本) | 通常作为非模板函数对象类型使用,例如 <code>std::ranges::equal_to{}</code> |- | 是否使用 concepts 约束 | 否。属于传统函数对象,主要依赖表达式是否可用 | 是。使用 C++20 concepts 约束 |- | 主要用途 | 传统 STL、容器、算法、哈希容器 | Ranges 算法、C++20 泛型代码 |- | 是否支持异构比较 | <code>std::equal_to&lt;&gt;</code>(透明版本)支持 | 支持,但要求类型满足相应的比较 concept,例如 <code>equality_comparable_with</code> |- | 语义要求 | 较宽松,通常只要 <code>a == b</code> 表达式可用即可 | 更严格,要求比较关系更完整、对称,并满足相关 concept |} ===逻辑运算类模板=== * std::logical_and * std::logical_or * std::logical_not ===位运算类模板=== * bit_and类模板 * bit_or类模板 * bit_xor类模板 * bit_not类模板 ===取反器=== not_fn函数模板:(C++17)创建返回其保有的函数对象的结果之补的函数对象 ===搜索器=== * default_searcher类模板:(C++17)标准 C++ 库搜索算法实现 * boyer_moore_searcher类模板:(C++17)Boyer-Moore 搜索算法实现 * boyer_moore_horspool_searcher类模板:(C++17)Boyer-Moore-Horspool 搜索算法实现 ==示例== <syntaxhighlight lang="cpp"> #include <functional> #include <iostream> using namespace std; std::function< int(int)> Functional; // 普通函数 int TestFunc(int a) { return a; } // Lambda表达式 auto lambda = [](int a)->int { return a; }; // 仿函数(functor) class Functor { public: int operator()(int a) { return a; } }; // 1.类成员函数 // 2.类静态函数 class TestClass { public: int ClassMember(int a) { return a; } static int StaticMember(int a) { return a; } }; int main() { // 普通函数 Functional = TestFunc; int result = Functional(10); cout << "普通函数:" << result << endl; // Lambda表达式 Functional = lambda; result = Functional(20); cout << "Lambda表达式:" << result << endl; // 仿函数 Functor testFunctor; Functional = testFunctor; result = Functional(30); cout << "仿函数:" << result << endl; // 类成员函数 TestClass testObj; Functional = std::bind(&TestClass::ClassMember, testObj, std::placeholders::_1); result = Functional(40); cout << "类成员函数:" << result << endl; // 类静态函数 Functional = TestClass::StaticMember; result = Functional(50); cout << "类静态函数:" << result << endl; return 0; } </syntaxhighlight> 6wj9sty2sleewpjo3aq0kxy0pw4odbh Wikibooks:互助客棧/topic list 4 32161 186043 186040 2026-06-25T13:31:07Z Cewbot 42738 [[User:Cewbot/log/20170915/configuration|生成議題列表:7個議題]] 186043 wikitext text/x-wiki <!-- 本頁面由機器人自動更新。若要改進,請聯繫機器人操作者。 --> {| class="wikitable sortable mw-collapsible" style="float:left;" |- ! data-sort-type="number" style="font-weight: normal;" | <small>#</small> !! 💭 話題 !! <span title="發言數/發言人次 (實際上為計算簽名數)">💬</span> !! <span title="參與討論人數/發言人數">👥</span> !! 🙋 最新發言 !! data-sort-type="isoDate" | <span title="最後更新">🕒 <small>(UTC+8)</small></span> |- | style="text-align: right;" | 1 | [[:Wikibooks:互助客棧#再谈改名建议|再谈改名建议]] | style="text-align: right;background-color: #ffe;" | 43 | style="text-align: right;" | 22 | style="background-color: #ddd;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-06-07T05:35:00.000Z" | 2026-06-07 <span style="color: blue;">13:35</span> |- | style="text-align: right;" | 2 | [[:Wikibooks:互助客棧#批量删除User:蛇守护的苹果堆创建的页面|批量删除User:蛇守护的苹果堆创建的页面]] | style="text-align: right;background-color: #ffe;" | 12 | style="text-align: right;" | 4 | style="background-color: #ddd;" | [[User:Sheminghui.WU|Sheminghui.WU]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-05-29T00:36:00.000Z" | 2026-05-29 <span style="color: blue;">08:36</span> |- | style="text-align: right;" | 3 | [[:Wikibooks:互助客棧#关于提交编辑上面的msgbox|关于提交编辑上面的msgbox]] | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | style="background-color: #bbb;" | [[User:Pawsdt|Pawsdt]] | style="background-color: #bbb;" data-sort-type="isoDate" data-sort-value="2026-03-17T16:44:00.000Z" | 2026-03-18 <span style="color: blue;">00:44</span> |- | style="text-align: right;" | 4 | [[:Wikibooks:互助客棧#防濫用過濾器3問題|防濫用過濾器3問題]] | style="text-align: right;background-color: #ffe;" | 11 | style="text-align: right;" | 3 | style="background-color: #ddd;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-06-11T16:09:00.000Z" | 2026-06-12 <span style="color: blue;">00:09</span> |- | style="text-align: right;" | 5 | [[:Wikibooks:互助客棧#台灣分會2026年6月對話時間|台灣分會2026年6月對話時間]] | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | [[User:MediaWiki message delivery|<small style="word-wrap: break-word; word-break: break-all;">MediaWiki message delivery</small>]] | data-sort-type="isoDate" data-sort-value="2026-06-21T00:19:00.000Z" | 2026-06-21 <span style="color: blue;">08:19</span> |- | style="text-align: right;" | 6 | style="max-width: 24em" | <small>[[:Wikibooks:互助客棧#RFC_about_AI-generated_content_in_Wikimedia_Commons|RFC about AI-generated content in Wikimedia Commons]]</small> | style="text-align: right;" | 2 | style="text-align: right;" | 2 | style="background-color: #eef;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #eef;" data-sort-type="isoDate" data-sort-value="2026-06-25T09:09:00.000Z" | 2026-06-25 <span style="color: blue;">17:09</span> |- | style="text-align: right;" | 7 | style="max-width: 24em" | <small>[[:Wikibooks:互助客棧#Deployment_of_Legal_and_Safety_Contacts_Link_in_the_Footer_of_Your_Wiki|<span lang="en" dir="ltr">Deployment of Legal and Safety Contacts Link in the Footer of Your Wiki</span>]]</small> | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | style="background-color: #efe;" | [[User:Sannita (WMF)|Sannita (WMF)]] | style="background-color: #efe;" data-sort-type="isoDate" data-sort-value="2026-06-25T13:30:00.000Z" | 2026-06-25 <span style="color: blue;">21:30</span> |} {| class="wikitable mw-collapsible mw-collapsed" style="float: left; margin-left: .5em;;{{#if:{{{no_time_legend|}}}|display:none;|}}" ! title="From the latest bot edit" | 發言更新圖例 |- | style="background-color: #efe;" | * 最近一小時內 |- | style="background-color: #eef;" | * 最近一日內 |- | | * 一週內 |- | style="background-color: #ddd;" | * 一個月內 |- | style="background-color: #bbb;" | * 逾一個月 |- ! 特殊狀態 |- | style="text-decoration: line-through" | 已移動至其他頁面<br />或完成討論之議題 |- ! 手動設定 |- | style="max-width: 12em;" | <small>當列表出現異常時,<br />請先檢查[[User:Cewbot/log/20170915/configuration|設定]]是否有誤</small> |- |} {{Clear}} omoxzy85pxickr6mi1fzt36gy6wr6kg 186045 186043 2026-06-25T19:31:28Z Cewbot 42738 [[User:Cewbot/log/20170915/configuration|生成議題列表:7個議題]] 186045 wikitext text/x-wiki <!-- 本頁面由機器人自動更新。若要改進,請聯繫機器人操作者。 --> {| class="wikitable sortable mw-collapsible" style="float:left;" |- ! data-sort-type="number" style="font-weight: normal;" | <small>#</small> !! 💭 話題 !! <span title="發言數/發言人次 (實際上為計算簽名數)">💬</span> !! <span title="參與討論人數/發言人數">👥</span> !! 🙋 最新發言 !! data-sort-type="isoDate" | <span title="最後更新">🕒 <small>(UTC+8)</small></span> |- | style="text-align: right;" | 1 | [[:Wikibooks:互助客棧#再谈改名建议|再谈改名建议]] | style="text-align: right;background-color: #ffe;" | 43 | style="text-align: right;" | 22 | style="background-color: #ddd;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-06-07T05:35:00.000Z" | 2026-06-07 <span style="color: blue;">13:35</span> |- | style="text-align: right;" | 2 | [[:Wikibooks:互助客棧#批量删除User:蛇守护的苹果堆创建的页面|批量删除User:蛇守护的苹果堆创建的页面]] | style="text-align: right;background-color: #ffe;" | 12 | style="text-align: right;" | 4 | style="background-color: #ddd;" | [[User:Sheminghui.WU|Sheminghui.WU]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-05-29T00:36:00.000Z" | 2026-05-29 <span style="color: blue;">08:36</span> |- | style="text-align: right;" | 3 | [[:Wikibooks:互助客棧#关于提交编辑上面的msgbox|关于提交编辑上面的msgbox]] | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | style="background-color: #bbb;" | [[User:Pawsdt|Pawsdt]] | style="background-color: #bbb;" data-sort-type="isoDate" data-sort-value="2026-03-17T16:44:00.000Z" | 2026-03-18 <span style="color: blue;">00:44</span> |- | style="text-align: right;" | 4 | [[:Wikibooks:互助客棧#防濫用過濾器3問題|防濫用過濾器3問題]] | style="text-align: right;background-color: #ffe;" | 11 | style="text-align: right;" | 3 | style="background-color: #ddd;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #ddd;" data-sort-type="isoDate" data-sort-value="2026-06-11T16:09:00.000Z" | 2026-06-12 <span style="color: blue;">00:09</span> |- | style="text-align: right;" | 5 | [[:Wikibooks:互助客棧#台灣分會2026年6月對話時間|台灣分會2026年6月對話時間]] | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | [[User:MediaWiki message delivery|<small style="word-wrap: break-word; word-break: break-all;">MediaWiki message delivery</small>]] | data-sort-type="isoDate" data-sort-value="2026-06-21T00:19:00.000Z" | 2026-06-21 <span style="color: blue;">08:19</span> |- | style="text-align: right;" | 6 | style="max-width: 24em" | <small>[[:Wikibooks:互助客棧#RFC_about_AI-generated_content_in_Wikimedia_Commons|RFC about AI-generated content in Wikimedia Commons]]</small> | style="text-align: right;" | 2 | style="text-align: right;" | 2 | style="background-color: #eef;" | [[User:Addonian1123|Addonian1123]] | style="background-color: #eef;" data-sort-type="isoDate" data-sort-value="2026-06-25T09:09:00.000Z" | 2026-06-25 <span style="color: blue;">17:09</span> |- | style="text-align: right;" | 7 | style="max-width: 24em" | <small>[[:Wikibooks:互助客棧#Deployment_of_Legal_and_Safety_Contacts_Link_in_the_Footer_of_Your_Wiki|<span lang="en" dir="ltr">Deployment of Legal and Safety Contacts Link in the Footer of Your Wiki</span>]]</small> | style="text-align: right;background-color: #fcc;" | 1 | style="text-align: right;background-color: #fcc;" | 1 | style="background-color: #eef;" | [[User:Sannita (WMF)|Sannita (WMF)]] | style="background-color: #eef;" data-sort-type="isoDate" data-sort-value="2026-06-25T13:30:00.000Z" | 2026-06-25 <span style="color: blue;">21:30</span> |} {| class="wikitable mw-collapsible mw-collapsed" style="float: left; margin-left: .5em;;{{#if:{{{no_time_legend|}}}|display:none;|}}" ! title="From the latest bot edit" | 發言更新圖例 |- | style="background-color: #efe;" | * 最近一小時內 |- | style="background-color: #eef;" | * 最近一日內 |- | | * 一週內 |- | style="background-color: #ddd;" | * 一個月內 |- | style="background-color: #bbb;" | * 逾一個月 |- ! 特殊狀態 |- | style="text-decoration: line-through" | 已移動至其他頁面<br />或完成討論之議題 |- ! 手動設定 |- | style="max-width: 12em;" | <small>當列表出現異常時,<br />請先檢查[[User:Cewbot/log/20170915/configuration|設定]]是否有誤</small> |- |} {{Clear}} gej4yhqxut923ik19dqy7377itc1luu