C++核心準(zhǔn)則?GSL.assert:斷言

GSL.assert: Assertions
GSL.assert:斷言
Expects?// precondition assertion. Currently placed in function bodies. Later, should be moved to declarations. //?Expects(p)?terminates the program unless?p == true?//?Expect?in under control of some options (enforcement, error message, alternatives to terminate)
期望//前提條件斷言。當(dāng)前放置在函數(shù)體中。以后,應(yīng)移到聲明位置。// Expects(p)會終止程序,除非p == true ?// Expect在某些選項(執(zhí)行,錯誤消息,終止選項)的控制下
Ensures?// postcondition assertion. Currently placed in function bodies. Later, should be moved to declarations.
確保//后置條件斷言。當(dāng)前放置在函數(shù)體中。以后,應(yīng)移至聲明。
These assertions are currently macros (yuck!) and must appear in function definitions (only) pending standard committee decisions on contracts and assertion syntax. See?the contract proposal; using the attribute syntax, for example,?Expects(p)?will become?[[expects: p]].
這些斷言當(dāng)前是宏(糟糕!),并且必須出現(xiàn)在函數(shù)定義中(僅),以待標(biāo)準(zhǔn)委員會對合同和斷言語法的決定。見合同建議書;使用屬性語法,例如,Expects(p)將變?yōu)閇[expects:p]]。
原文鏈接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gslassert-assertions
新書介紹
《實戰(zhàn)Python設(shè)計模式》是作者最近出版的新書,拜托多多關(guān)注!

本書利用Python 的標(biāo)準(zhǔn)GUI 工具包tkinter,通過可執(zhí)行的示例對23 個設(shè)計模式逐個進(jìn)行說明。這樣一方面可以使讀者了解真實的軟件開發(fā)工作中每個設(shè)計模式的運用場景和想要解決的問題;另一方面通過對這些問題的解決過程進(jìn)行說明,讓讀者明白在編寫代碼時如何判斷使用設(shè)計模式的利弊,并合理運用設(shè)計模式。
對設(shè)計模式感興趣而且希望隨學(xué)隨用的讀者通過本書可以快速跨越從理解到運用的門檻;希望學(xué)習(xí)Python GUI 編程的讀者可以將本書中的示例作為設(shè)計和開發(fā)的參考;使用Python 語言進(jìn)行圖像分析、數(shù)據(jù)處理工作的讀者可以直接以本書中的示例為基礎(chǔ),迅速構(gòu)建自己的系統(tǒng)架構(gòu)。
覺得本文有幫助?請分享給更多人。
關(guān)注微信公眾號【面向?qū)ο笏伎肌枯p松學(xué)習(xí)每一天!
面向?qū)ο箝_發(fā),面向?qū)ο笏伎迹?/span>
