1ModernC++Tutorial:C++11/14/17/20OntheFlyChangkunOu(hi[at]changkun.de)Lastupdate:January24,2021NoticeThecontentinthisPDFfilemayoutdated,pleasecheckourwebsiteorGitHubrepositoryforthelatestbookupdates.LicenseThisworkwaswrittenbyOuChangkunandlicensedunderaCreativeCommonsAttribution-NonCommercial-NoDerivatives4.0InternationalLicense.http://creativecommons.org/licenses/by-nc-nd/4.0/2CONTENCONTEN3ContentsPreface8Introduction......................................................................................................................................................8Targets...............................................................................................................................................................8Purpose..............................................................................................................................................................9Code...................................................................................................................................................................9Exercises............................................................................................................................................................9Chapter01:TowardsModernC++91.1DeprecatedFeatures................................................................................................................................101.2CompatibilitieswithC............................................................................................................................11FurtherReadings............................................................................................................................................13Chapter02:LanguageUsabilityEnhancements132.1Constants..................................................................................................................................................13nullptr.....................................................................................................................................................13constexpr................................................................................................................................................152.2Variablesandinitialization.....................................................................................................................17if-switch..................................................................................................................................................17Initializerlist..........................................................................................................................................18Structuredbinding................................................................................................................................202.3Typeinference..........................................................................................................................................20auto.........................................................................................................................................................20decltype..................................................................................................................................................22tailtypeinfere...