自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

面向对象思考

天下难事必作於易。天下大事必作於细。

  • 博客(22)
  • 资源 (24)
  • 收藏
  • 关注

翻译 C++核心准则:积极、正确地使用标准库

SL.1: Use libraries wherever possibleSL.1:在任何可能的情况下使用已有库Reason(原因)Save time. Don't re-invent the wheel. Don't replicate the work of others. Benefit from other people's work when they make improvements. Help other people when you make improvements..

2020-12-25 15:33:36 454

翻译 C++核心准则SF.22:为所有内部/非输出实体使用非命名(无名)命名空间

SF.22: Use an unnamed (anonymous) namespace for all internal/non-exported entitiesSF.22:为所有内部/非输出实体使用非命名(无名)命名空间Reason(原因)Nothing external can depend on an entity in a nested unnamed namespace. Consider putting every definition in an implementatio.

2020-12-24 10:40:39 437

翻译 C++核心准则:SF.12:使用双引号形式的#include语句包含相对路径中的文件,用角括号形式包含所有其他位置的文件​

SF.12: Prefer the quoted form of#includefor files relative to the including file and the angle bracket form everywhere elseSF.12:使用双引号形式的#include语句包含相对路径中的文件,用角括号形式包含所有其他位置的文件Reason(原因)Thestandardprovides flexibility for compilers to implement...

2020-12-23 14:42:16 606

翻译 C++核心准则SF.11​:头文件应该可以独立工作​

SF.11: Header files should be self-containedSF.11:头文件应该可以独立工作Reason(原因)Usability, headers should be simple to use and work when included on their own. Headers should encapsulate the functionality they provide. Avoid clients of a header having to m.

2020-12-22 15:42:50 475

翻译 C++核心准则​SF.10:避免依赖隐式包含的名称

SF.10: Avoid dependencies on implicitly#included namesSF.10:避免依赖隐式包含的名称Reason(原因)Avoid surprises. Avoid having to change#includes if an#included header changes. Avoid accidentally becoming dependent on implementation details and logically separ...

2020-12-21 14:09:41 391

翻译 C++核心准则​SF.9:避免源文件之间的循环依赖

SF.9: Avoid cyclic dependencies among source filesSF.9:避免源文件之间的循环依赖Reason(原因)Cycles complicate comprehension and slow down compilation. They also complicate conversion to use language-supported modules (when they become available).循环让理解更困难并减慢编译过.

2020-12-20 15:30:46 488 1

翻译 C++核心准则​SF.8:为所有的.h文件使用包含监护

SF.8: Use#includeguards for all.hfilesSF.8:为所有的.h文件使用包含监护Reason(原因)To avoid files being#included several times.为了避免文件被多次包含。In order to avoid include guard collisions, do not just name the guard after the filename. Be sure to also include ...

2020-12-19 15:25:53 452 2

翻译 C++核心准则SF.7:不要在头文件中的全局作用域中使用using namespace指令

SF.7: Don't writeusing namespaceat global scope in a header fileSF.7:不要在头文件中的全局作用域中使用using namespace指令Reason(原因)Doing so takes away an#includer's ability to effectively disambiguate and to use alternatives. It also makes#included headers order...

2020-12-18 09:38:35 1531

翻译 C++核心准则SF.6:(只)为转换,基础库或在局部作用域内部使用using namspace指令

SF.6: Useusing namespacedirectives for transition, for foundation libraries (such asstd), or within a local scope (only)SF.6:(只)为转换,基础库(例如std)或在局部作用域内部使用using namspace指令Reason(原因)using namespacecan lead to name clashes, so it should be used sp...

2020-12-17 14:18:34 430

翻译 C++核心准则SF.5: .cpp文件必须包含定义它接口的.h文件

SF.5: A.cppfile must include the.hfile(s) that defines its interfaceSF.5: .cpp文件必须包含定义它接口的.h文件Reason(原因)This enables the compiler to do an early consistency check.这样可以让编译器尽早进行一致性检查。Example, bad(反面示例)// foo.h:void foo(int);int bar(l...

2020-12-16 13:50:13 578

翻译 C++核心准则SF.4:在其他声明之前include .h文件

SF.4: Include.hfiles before other declarations in a fileSF.4:在其他声明之前include .h文件Reason(原因)Minimize context dependencies and increase readability.最小化上下文依赖性并提高可读性。Example(示例)#include <vector>#include <algorithm>#include &lt...

2020-12-15 14:47:02 360

翻译 C++核心准则SF.3:使用.h文件管理所有在多个源文件中使用的声明

SF.3: Use.hfiles for all declarations used in multiple source filesSF.3:使用.h文件管理所有在多个源文件中使用的声明Reason(原因)Maintainability. Readability.维护性。可读性。Example, bad(反面示例)// bar.cpp:void bar() { cout << "bar\n"; }// foo.cpp:extern void b...

2020-12-14 16:17:57 313

翻译 C++核心准则SF.2:.h文件一定不能包含对象定义或者非inline函数定义

SF.2: A.hfile must not contain object definitions or non-inline function definitionsSF.2:.h文件一定不能包含对象定义或者非inline函数定义Reason(原因)Including entities subject to the one-definition rule leads to linkage errors.对于包含实物对象违反一次定义规则,会导致链接错误。Example(示...

2020-12-11 14:43:37 394 1

翻译 C++核心准则SF.1:如果你的项目没有正在遵从的其他习惯,为代码文件使用.cpp后缀,为接口文件使用.h后缀

SF.1: Use a.cppsuffix for code files and.hfor interface files if your project doesn't already follow another conventionSF.1:如果你的项目没有正在遵从的其他习惯,为代码文件使用.cpp后缀,为接口文件使用.h后缀Reason(原因)It's a longstanding convention. But consistency is more important,...

2020-12-10 14:31:47 433

翻译 C++核心准则​CPL.2:如果你必须使用C,使用C和C++的共同子集,并且使用C++编译器编译C代码

CPL.2: If you must use C, use the common subset of C and C++, and compile the C code as C++CPL.2:如果你必须使用C,使用C和C++的共同子集,并且使用C++编译器编译C代码Reason(原因)That subset can be compiled with both C and C++ compilers, and when compiled as C++ is better type chec.

2020-12-09 15:33:48 630

翻译 C++核心准则​CPL.1:C++比C更好​

CPL.1: Prefer C++ to CCPL.1:C++比C更好Reason(原因)C++ provides better type checking and more notational support. It provides better support for high-level programming and often generates faster code.C++提供更好的类型检查和更多的记法支持。它为高层次编程提供更好的支持,通常也会产生更快的代码。..

2020-12-08 14:52:44 499

翻译 C++核心准则T.150:用static_assert检查类和概念的匹配性

T.150: Check that a class matches a concept usingstatic_assertT.150:用static_assert检查类和概念的匹配性Reason(原因)If you intend for a class to match a concept, verifying that early saves users pain.如果你希望一个类和概念相匹配,尽早地检查可以减轻用户的痛苦。Example(示例)class X {...

2020-12-07 16:56:18 345

翻译 C++核心准则T.144:不要特化函数模板

T.144: Don't specialize function templatesT.144:不要特化函数模板Reason(原因)You can't partially specialize a function template per language rules. You can fully specialize a function template but you almost certainly want to overload instead -- because func.

2020-12-05 14:45:59 494

翻译 C++核心准则​T.143:避免无意中编写非通用代码

T.143: Don't write unintentionally non-generic codeT.143:避免无意中编写非通用代码Reason(原因)Generality. Reusability. Don't gratuitously commit to details; use the most general facilities available.通用性。重用性。不要无故陷入细节。使用可用的,更加通用的功能。Example(示例)Use!=inste...

2020-12-04 15:30:49 382

翻译 C++核心准则​T.141:如果你需要只在一个地方使用的简单的函数对象,使用无名的lambda表达式

T.141: Use an unnamed lambda if you need a simple function object in one place onlyT.141:如果你需要只在一个地方使用的简单的函数对象,使用无名的lambda表达式Reason(原因)That makes the code concise and gives better locality than alternatives.这种做法使代码更简洁,比其它方式具有更好的本地性。Example(..

2020-12-03 14:15:48 415

翻译 C++核心准则​T.140:为所有可能重用的操作命名

T.140: Name all operations with potential for reuseT.140:为所有可能重用的操作命名Reason(原因)Documentation, readability, opportunity for reuse.文档化,可读性,重用的机会。Example(示例)struct Rec { string name; string addr; int id; // unique identi..

2020-12-02 14:32:04 266

翻译 C++核心准则​T.123:使用常量表达式函数在编译时求值

T.123: Useconstexprfunctions to compute values at compile timeT.123:使用常量表达式函数在编译时求值Reason(原因)A function is the most obvious and conventional way of expressing the computation of a value. Often aconstexprfunction implies less compile-time overh...

2020-12-01 14:28:42 420

Aduino UNO D1 R32 硬件包

Aduino UNO D1 R32开发环境构筑时使用的硬件开发包,包含2020年3月的最新文件: arduino-esp32-master.zip esptool-2.6.1-windows.zip mkspiffs-0.2.3-arduino-esp32-win32.zip xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip

2020-03-15

多任务编程超入门-(11) 学以致用

多任务编程超入门-(11) 学以致用的示例工程,代码

2017-07-26

多任务编程超入门-(10) 线程同步,数据交换的序列图

多任务编程超入门-(10) 线程同步,数据交换的序列图

2017-07-23

多任务编程超入门-(9) 线程同步

多任务编程超入门-(9) 线程同步 示例代码,QT工程

2017-07-19

多任务编程超入门-(8) 递归互斥量

多任务编程超入门-(8) 递归互斥量 示例工程,代码

2017-07-17

多任务编程超入门-(5) 对症下药

多任务编程超入门-(5) 对症下药 示例代码

2017-07-11

多任务编程超入门-(4) 发生了什么? 示例代码

多任务编程超入门-(4) 发生了什么? 示例代码

2017-07-10

多任务编程超入门-(4) 发生了什么?

多任务编程超入门-(4) 发生了什么? 出现的QT工程文件,示例代码

2017-07-10

多任务编程超入门-(2) 线程协作的理想和现实 示例代码

多任务编程超入门-(2) 线程协作的理想和现实 示例代码

2017-07-09

Android函数计算器(含源码,测试工程)

原创Android环境下的计算器的源代码,工程文件 Android环境下的单元测试工程及源代码。

2011-12-18

Android歌词秀源代码及工程文件

Android歌词秀源的代码及工程文件。适用Android2.1以上系统

2011-11-27

Anroid歌词秀1.5版

Anroid歌词秀1.5版的安装包,下载后可直接安装在Android(版本2.1以上)上。

2011-11-27

Qt环境下开发的计算器源码

Qt环境下开发的计算器源码 支持三角函数,反三角函数,求和,平均值,乘方,开方,对数 当然还有包含嵌套的四则运算。

2011-10-14

Qt开发的计算器(可执行文件)

利用Qt开发的计算器的可执行文件。 可以直接在Widnows环境中执行。

2011-10-14

[Android应用开发记录-字幕播放器(5)完善]附属工程,源码

[Android应用开发记录-字幕播放器(5)完善]附属工程,源码 1.将操作按钮改成图标方式 2.有电话接入时暂停播放。 3.通过线控按钮控制播放,暂停,上一句歌词,下一句歌词功能。(Android2.2以上版本) 4.拔掉耳机线时自动暂停(Android2.2以上版本) 5.在【正在进行中】画面中表示启动用快捷方式 6.改善(没有解决)定位歌词不准确(选中的歌词的前面一段时间不能播放)

2011-09-07

Android应用开发记录-字幕播放器(5)完善附带工程,源码

Android应用开发记录-字幕播放器(5)完善附带工程,源码 1.将操作按钮改成图标方式 2.有电话接入时暂停播放。 3.通过线控按钮控制播放,暂停,上一句歌词,下一句歌词功能。(Android2.2以上版本) 4.拔掉耳机线时自动暂停(Android2.2以上版本) 5.在【正在进行中】画面中表示启动用快捷方式 6.改善(没有解决)定位歌词不准确(选中的歌词的前面一段时间不能播放)

2011-09-07

LyricPlayer类图

目前内容: LyricPlayer全体类图 SaftyTimer 类图第一版,持续更新中。

2011-09-04

LyricPlayer for Android 2.1

对软件进行如下变更后生成的安装文件。 将Android版本调整为2.1 按钮换成ImageButton 通过点击直接选择歌词播放

2011-09-03

Android应用开发记录-字幕播放器(4)完成

<<Android应用开发记录-字幕播放器(4)完成>>配合的工程文件,源码,用于动作确认的歌曲及歌词 另外,工程是针对Android2.2建立的。 如果想在Android2.1运行,可以修改工程文件或从下面地址下载针对2.1做的安装包,应该可以直接安装。 http://download.csdn.net/source/3571257

2011-08-28

Android应用开发记录-字幕播放器(3)工程包

用于【博客:Android应用开发记录-字幕播放器(3)使用的Service的音频播放器的】的工程文件及源码

2011-08-18

Android学习-字幕播放器(2)先来一个音频播放器

Android学习-字幕播放器(2)的工程和源代码

2011-08-13

Android小游戏-9宫格类图类图

Android小游戏-9宫格类图类图,配合源码、 请用EA(Enterprise Architect)打开

2011-08-11

Android下的原创小游戏-九宫格

为了学习Android,自己编了一个小游戏,就是9宫格。 功能: 1.自动分析可选数字。 2.Undo(用了Command设计模式) 3.支持自编题目。 内容: Andorid工程,源码

2011-08-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除