ChangeLog.rst 236 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922
  1. 10.1.1 - 2023-08-28
  2. -------------------
  3. * Added formatters for ``std::atomic`` and ``atomic_flag``
  4. (`#3574 <https://github.com/fmtlib/fmt/pull/3574>`_,
  5. `#3594 <https://github.com/fmtlib/fmt/pull/3594>`_).
  6. Thanks `@wangzw (Zhanwei Wang) <https://github.com/wangzw>`_ and
  7. `@AlexGuteniev (Alex Guteniev) <https://github.com/AlexGuteniev>`_.
  8. * Fixed an error about partial specialization of ``formatter<string>``
  9. after instantiation when compiled with gcc and C++20
  10. (`#3584 <https://github.com/fmtlib/fmt/issues/3584>`_).
  11. * Fixed compilation as a C++20 module with gcc and clang
  12. (`#3587 <https://github.com/fmtlib/fmt/issues/3587>`_,
  13. `#3597 <https://github.com/fmtlib/fmt/pull/3597>`_,
  14. `#3605 <https://github.com/fmtlib/fmt/pull/3605>`_). Thanks
  15. `@MathewBensonCode (Mathew Benson) <https://github.com/MathewBensonCode>`_.
  16. * Made ``fmt::to_string`` work with types that have ``format_as`` overloads
  17. (`#3575 <https://github.com/fmtlib/fmt/pull/3575>`_).
  18. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  19. * Made ``formatted_size`` work with integral format specifiers at compile time
  20. (`#3591 <https://github.com/fmtlib/fmt/pull/3591>`_).
  21. Thanks `@elbeno (Ben Deane) <https://github.com/elbeno>`_.
  22. * Fixed a warning about the ``no_unique_address`` attribute on clang-cl
  23. (`#3599 <https://github.com/fmtlib/fmt/pull/3599>`_).
  24. Thanks `@lukester1975 <https://github.com/lukester1975>`_.
  25. * Improved compatibility with the legacy GBK encoding
  26. (`#3598 <https://github.com/fmtlib/fmt/issues/3598>`_,
  27. `#3599 <https://github.com/fmtlib/fmt/pull/3599>`_).
  28. Thanks `@YuHuanTin <https://github.com/YuHuanTin>`_.
  29. * Added OpenSSF Scorecard analysis
  30. (`#3530 <https://github.com/fmtlib/fmt/issues/3530>`_,
  31. `#3571 <https://github.com/fmtlib/fmt/pull/3571>`_).
  32. Thanks `@joycebrum (Joyce) <https://github.com/joycebrum>`_.
  33. * Updated CI dependencies
  34. (`#3591 <https://github.com/fmtlib/fmt/pull/3591>`_,
  35. `#3592 <https://github.com/fmtlib/fmt/pull/3592>`_,
  36. `#3593 <https://github.com/fmtlib/fmt/pull/3593>`_,
  37. `#3602 <https://github.com/fmtlib/fmt/pull/3602>`_).
  38. 10.1.0 - 2023-08-12
  39. -------------------
  40. * Optimized format string compilation resulting in up to 40% speed up in
  41. compiled ``format_to`` and ~4x speed up in compiled ``format_to_n`` on a
  42. concatenation benchmark (`#3133 <https://github.com/fmtlib/fmt/issues/3133>`_,
  43. `#3484 <https://github.com/fmtlib/fmt/issues/3484>`_).
  44. {fmt} 10.0::
  45. ---------------------------------------------------------
  46. Benchmark Time CPU Iterations
  47. ---------------------------------------------------------
  48. BM_format_to 78.9 ns 78.9 ns 8881746
  49. BM_format_to_n 568 ns 568 ns 1232089
  50. {fmt} 10.1::
  51. ---------------------------------------------------------
  52. Benchmark Time CPU Iterations
  53. ---------------------------------------------------------
  54. BM_format_to 54.9 ns 54.9 ns 12727944
  55. BM_format_to_n 133 ns 133 ns 5257795
  56. * Optimized storage of an empty allocator in ``basic_memory_buffer``
  57. (`#3485 <https://github.com/fmtlib/fmt/pull/3485>`_).
  58. Thanks `@Minty-Meeo <https://github.com/Minty-Meeo>`_.
  59. * Added formatters for proxy references to elements of ``std::vector<bool>`` and
  60. ``std::bitset<N>`` (`#3567 <https://github.com/fmtlib/fmt/issues/3567>`_,
  61. `#3570 <https://github.com/fmtlib/fmt/pull/3570>`_).
  62. For example (`godbolt <https://godbolt.org/z/zYb79Pvn8>`__):
  63. .. code:: c++
  64. #include <vector>
  65. #include <fmt/std.h>
  66. int main() {
  67. auto v = std::vector<bool>{true};
  68. fmt::print("{}", v[0]);
  69. }
  70. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_ and
  71. `@felix642 (Félix-Antoine Constantin) <https://github.com/felix642>`_.
  72. * Fixed an ambiguous formatter specialization for containers that look like
  73. container adaptors such as ``boost::flat_set``
  74. (`#3556 <https://github.com/fmtlib/fmt/issues/3556>`_,
  75. `#3561 <https://github.com/fmtlib/fmt/pull/3561>`_).
  76. Thanks `@5chmidti <https://github.com/5chmidti>`_.
  77. * Fixed compilation when formatting durations not convertible from
  78. ``std::chrono::seconds`` (`#3430 <https://github.com/fmtlib/fmt/pull/3430>`_).
  79. Thanks `@patlkli (Patrick Geltinger) <https://github.com/patlkli>`_.
  80. * Made the ``formatter`` specialization for ``char*`` const-correct
  81. (`#3432 <https://github.com/fmtlib/fmt/pull/3432>`_).
  82. Thanks `@timsong-cpp <https://github.com/timsong-cpp>`_.
  83. * Made ``{}`` and ``{:}`` handled consistently during compile-time checks
  84. (`#3526 <https://github.com/fmtlib/fmt/issues/3526>`_).
  85. * Disallowed passing temporaries to ``make_format_args`` to improve API safety
  86. by preventing dangling references.
  87. * Improved the compile-time error for unformattable types
  88. (`#3478 <https://github.com/fmtlib/fmt/pull/3478>`_).
  89. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  90. * Improved the floating-point formatter
  91. (`#3448 <https://github.com/fmtlib/fmt/pull/3448>`_,
  92. `#3450 <https://github.com/fmtlib/fmt/pull/3450>`_).
  93. Thanks `@florimond-collette (Florimond Collette)
  94. <https://github.com/florimond-collette>`_.
  95. * Fixed handling of precision for ``long double`` larger than 64 bits.
  96. (`#3539 <https://github.com/fmtlib/fmt/issues/3539>`_,
  97. `#3564 <https://github.com/fmtlib/fmt/issues/3564>`_).
  98. * Made floating-point and chrono tests less platform-dependent
  99. (`#3337 <https://github.com/fmtlib/fmt/issues/3337>`_,
  100. `#3433 <https://github.com/fmtlib/fmt/issues/3433>`_,
  101. `#3434 <https://github.com/fmtlib/fmt/pull/3434>`_).
  102. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  103. * Removed the remnants of the Grisu floating-point formatter that has been
  104. replaced by Dragonbox in earlier versions.
  105. * Added ``throw_format_error`` to the public API
  106. (`#3551 <https://github.com/fmtlib/fmt/pull/3551>`_).
  107. Thanks `@mjerabek (Martin Jeřábek) <https://github.com/mjerabek>`_.
  108. * Made ``FMT_THROW`` assert even if assertions are disabled when compiling with
  109. exceptions disabled (`#3418 <https://github.com/fmtlib/fmt/issues/3418>`_,
  110. `#3439 <https://github.com/fmtlib/fmt/pull/3439>`_).
  111. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  112. * Made ``format_as`` and ``std::filesystem::path`` formatter work with exotic
  113. code unit types.
  114. (`#3457 <https://github.com/fmtlib/fmt/pull/3457>`_,
  115. `#3476 <https://github.com/fmtlib/fmt/pull/3476>`_).
  116. Thanks `@gix (Nico Rieck) <https://github.com/gix>`_,
  117. `@hmbj (Hans-Martin B. Jensen) <https://github.com/hmbj>`_.
  118. * Added support for the ``?`` format specifier to ``std::filesystem::path`` and
  119. made the default unescaped for consistency with strings.
  120. * Deprecated the wide stream overload of ``printf``.
  121. * Removed unused ``basic_printf_parse_context``.
  122. * Improved RTTI detection used when formatting exceptions
  123. (`#3468 <https://github.com/fmtlib/fmt/pull/3468>`_).
  124. Thanks `@danakj (Dana Jansens) <https://github.com/danakj>`_.
  125. * Improved compatibility with VxWorks7
  126. (`#3467 <https://github.com/fmtlib/fmt/pull/3467>`_).
  127. Thanks `@wenshan1 (Bin Lan) <https://github.com/wenshan1>`_.
  128. * Improved documentation
  129. (`#3174 <https://github.com/fmtlib/fmt/issues/3174>`_,
  130. `#3423 <https://github.com/fmtlib/fmt/issues/3423>`_,
  131. `#3454 <https://github.com/fmtlib/fmt/pull/3454>`_,
  132. `#3458 <https://github.com/fmtlib/fmt/issues/3458>`_,
  133. `#3461 <https://github.com/fmtlib/fmt/pull/3461>`_,
  134. `#3487 <https://github.com/fmtlib/fmt/issues/3487>`_,
  135. `#3515 <https://github.com/fmtlib/fmt/pull/3515>`_).
  136. Thanks `@zencatalyst (Kasra Hashemi) <https://github.com/zencatalyst>`_,
  137. `@rlalik <https://github.com/rlalik>`_,
  138. `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_.
  139. * Improved build and CI configurations
  140. (`#3449 <https://github.com/fmtlib/fmt/issues/3449>`_,
  141. `#3451 <https://github.com/fmtlib/fmt/pull/3451>`_,
  142. `#3452 <https://github.com/fmtlib/fmt/pull/3452>`_,
  143. `#3453 <https://github.com/fmtlib/fmt/pull/3453>`_,
  144. `#3459 <https://github.com/fmtlib/fmt/pull/3459>`_,
  145. `#3481 <https://github.com/fmtlib/fmt/issues/3481>`_,
  146. `#3486 <https://github.com/fmtlib/fmt/pull/3486>`_,
  147. `#3489 <https://github.com/fmtlib/fmt/issues/3489>`_,
  148. `#3496 <https://github.com/fmtlib/fmt/pull/3496>`_,
  149. `#3517 <https://github.com/fmtlib/fmt/issues/3517>`_,
  150. `#3523 <https://github.com/fmtlib/fmt/pull/3523>`_,
  151. `#3563 <https://github.com/fmtlib/fmt/pull/3563>`_).
  152. Thanks `@joycebrum (Joyce) <https://github.com/joycebrum>`_,
  153. `@glebm (Gleb Mazovetskiy) <https://github.com/glebm>`_,
  154. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  155. `@petrmanek (Petr Mánek) <https://github.com/petrmanek>`_,
  156. `@setoye (Alta) <https://github.com/setoye>`_,
  157. `@abouvier (Alexandre Bouvier) <https://github.com/abouvier>`_.
  158. * Fixed various warnings and compilation issues
  159. (`#3408 <https://github.com/fmtlib/fmt/issues/3408>`_,
  160. `#3424 <https://github.com/fmtlib/fmt/issues/3424>`_,
  161. `#3444 <https://github.com/fmtlib/fmt/issues/3444>`_,
  162. `#3446 <https://github.com/fmtlib/fmt/pull/3446>`_,
  163. `#3475 <https://github.com/fmtlib/fmt/pull/3475>`_,
  164. `#3482 <https://github.com/fmtlib/fmt/pull/3482>`_,
  165. `#3492 <https://github.com/fmtlib/fmt/issues/3492>`_,
  166. `#3493 <https://github.com/fmtlib/fmt/pull/3493>`_,
  167. `#3508 <https://github.com/fmtlib/fmt/pull/3508>`_,
  168. `#3509 <https://github.com/fmtlib/fmt/issues/3509>`_,
  169. `#3533 <https://github.com/fmtlib/fmt/issues/3533>`_,
  170. `#3542 <https://github.com/fmtlib/fmt/pull/3542>`_,
  171. `#3543 <https://github.com/fmtlib/fmt/issues/3543>`_,
  172. `#3540 <https://github.com/fmtlib/fmt/issues/3540>`_,
  173. `#3544 <https://github.com/fmtlib/fmt/pull/3544>`_,
  174. `#3548 <https://github.com/fmtlib/fmt/issues/3548>`_,
  175. `#3549 <https://github.com/fmtlib/fmt/pull/3549>`_,
  176. `#3550 <https://github.com/fmtlib/fmt/pull/3550>`_,
  177. `#3552 <https://github.com/fmtlib/fmt/pull/3552>`_).
  178. Thanks `@adesitter (Arnaud Desitter) <https://github.com/adesitter>`_,
  179. `@hmbj (Hans-Martin B. Jensen) <https://github.com/hmbj>`_,
  180. `@Minty-Meeo <https://github.com/Minty-Meeo>`_,
  181. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  182. `@TobiSchluter (Tobias Schlüter) <https://github.com/TobiSchluter>`_,
  183. `@kieranclancy (Kieran Clancy) <https://github.com/kieranclancy>`_,
  184. `@alexeedm (Dmitry Alexeev) <https://github.com/alexeedm>`_,
  185. `@jurihock (Jürgen Hock) <https://github.com/jurihock>`_,
  186. `@Ozomahtli <https://github.com/Ozomahtli>`_,
  187. `@razaqq <https://github.com/razaqq>`_.
  188. 10.0.0 - 2023-05-09
  189. -------------------
  190. * Replaced Grisu with a new floating-point formatting algorithm for given
  191. precision (`#3262 <https://github.com/fmtlib/fmt/issues/3262>`_,
  192. `#2750 <https://github.com/fmtlib/fmt/issues/2750>`_,
  193. `#3269 <https://github.com/fmtlib/fmt/pull/3269>`_,
  194. `#3276 <https://github.com/fmtlib/fmt/pull/3276>`_).
  195. The new algorithm is based on Dragonbox already used for the
  196. shortest representation and gives substantial performance improvement:
  197. .. image:: https://user-images.githubusercontent.com/33922675/
  198. 211956670-84891a09-6867-47d9-82fc-3230da7abe0f.png
  199. * Red: new algorithm
  200. * Green: new algorithm with ``FMT_USE_FULL_CACHE_DRAGONBOX`` defined to 1
  201. * Blue: old algorithm
  202. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  203. * Replaced ``snprintf``-based hex float formatter with an internal
  204. implementation (`#3179 <https://github.com/fmtlib/fmt/pull/3179>`_,
  205. `#3203 <https://github.com/fmtlib/fmt/pull/3203>`_).
  206. This removes the last usage of ``s(n)printf`` in {fmt}.
  207. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  208. * Fixed alignment of floating-point numbers with localization
  209. (`#3263 <https://github.com/fmtlib/fmt/issues/3263>`_,
  210. `#3272 <https://github.com/fmtlib/fmt/pull/3272>`_).
  211. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  212. * Made handling of ``#`` consistent with ``std::format``.
  213. * Improved C++20 module support
  214. (`#3134 <https://github.com/fmtlib/fmt/pull/3134>`_,
  215. `#3254 <https://github.com/fmtlib/fmt/pull/3254>`_,
  216. `#3386 <https://github.com/fmtlib/fmt/pull/3386>`_,
  217. `#3387 <https://github.com/fmtlib/fmt/pull/3387>`_,
  218. `#3388 <https://github.com/fmtlib/fmt/pull/3388>`_,
  219. `#3392 <https://github.com/fmtlib/fmt/pull/3392>`_,
  220. `#3397 <https://github.com/fmtlib/fmt/pull/3397>`_,
  221. `#3399 <https://github.com/fmtlib/fmt/pull/3399>`_,
  222. `#3400 <https://github.com/fmtlib/fmt/pull/3400>`_).
  223. Thanks `@laitingsheng (Tinson Lai) <https://github.com/laitingsheng>`_,
  224. `@Orvid (Orvid King) <https://github.com/Orvid>`_,
  225. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  226. Switched to the `modules CMake library <https://github.com/vitaut/modules>`_
  227. which allows building {fmt} as a C++20 module with clang::
  228. CXX=clang++ cmake -DFMT_MODULE=ON .
  229. make
  230. * Made ``format_as`` work with any user-defined type and not just enums.
  231. For example (`godbolt <https://godbolt.org/z/b7rqhq5Kh>`__):
  232. .. code:: c++
  233. #include <fmt/format.h>
  234. struct floaty_mc_floatface {
  235. double value;
  236. };
  237. auto format_as(floaty_mc_floatface f) { return f.value; }
  238. int main() {
  239. fmt::print("{:8}\n", floaty_mc_floatface{0.42}); // prints " 0.42"
  240. }
  241. * Removed deprecated implicit conversions for enums and conversions to primitive
  242. types for compatibility with ``std::format`` and to prevent potential ODR
  243. violations. Use ``format_as`` instead.
  244. * Added support for fill, align and width to the time point formatter
  245. (`#3237 <https://github.com/fmtlib/fmt/issues/3237>`_,
  246. `#3260 <https://github.com/fmtlib/fmt/pull/3260>`_,
  247. `#3275 <https://github.com/fmtlib/fmt/pull/3275>`_).
  248. For example (`godbolt <https://godbolt.org/z/rKP6MGz6c>`__):
  249. .. code:: c++
  250. #include <fmt/chrono.h>
  251. int main() {
  252. // prints " 2023"
  253. fmt::print("{:>8%Y}\n", std::chrono::system_clock::now());
  254. }
  255. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  256. * Implemented formatting of subseconds
  257. (`#2207 <https://github.com/fmtlib/fmt/issues/2207>`_,
  258. `#3117 <https://github.com/fmtlib/fmt/issues/3117>`_,
  259. `#3115 <https://github.com/fmtlib/fmt/pull/3115>`_,
  260. `#3143 <https://github.com/fmtlib/fmt/pull/3143>`_,
  261. `#3144 <https://github.com/fmtlib/fmt/pull/3144>`_,
  262. `#3349 <https://github.com/fmtlib/fmt/pull/3349>`_).
  263. For example (`godbolt <https://godbolt.org/z/45738oGEo>`__):
  264. .. code:: c++
  265. #include <fmt/chrono.h>
  266. int main() {
  267. // prints 01.234567
  268. fmt::print("{:%S}\n", std::chrono::microseconds(1234567));
  269. }
  270. Thanks `@patrickroocks (Patrick Roocks) <https://github.com/patrickroocks>`_
  271. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  272. `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  273. * Added precision support to ``%S``
  274. (`#3148 <https://github.com/fmtlib/fmt/pull/3148>`_).
  275. Thanks `@SappyJoy (Stepan Ponomaryov) <https://github.com/SappyJoy>`_
  276. * Added support for ``std::utc_time``
  277. (`#3098 <https://github.com/fmtlib/fmt/issues/3098>`_,
  278. `#3110 <https://github.com/fmtlib/fmt/pull/3110>`_).
  279. Thanks `@patrickroocks (Patrick Roocks) <https://github.com/patrickroocks>`_.
  280. * Switched formatting of ``std::chrono::system_clock`` from local time to UTC
  281. for compatibility with the standard
  282. (`#3199 <https://github.com/fmtlib/fmt/issues/3199>`_,
  283. `#3230 <https://github.com/fmtlib/fmt/pull/3230>`_).
  284. Thanks `@ned14 (Niall Douglas) <https://github.com/ned14>`_.
  285. * Added support for ``%Ez`` and ``%Oz`` to chrono formatters.
  286. (`#3220 <https://github.com/fmtlib/fmt/issues/3220>`_,
  287. `#3222 <https://github.com/fmtlib/fmt/pull/3222>`_).
  288. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  289. * Improved validation of format specifiers for ``std::chrono::duration``
  290. (`#3219 <https://github.com/fmtlib/fmt/issues/3219>`_,
  291. `#3232 <https://github.com/fmtlib/fmt/pull/3232>`_).
  292. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  293. * Fixed formatting of time points before the epoch
  294. (`#3117 <https://github.com/fmtlib/fmt/issues/3117>`_,
  295. `#3261 <https://github.com/fmtlib/fmt/pull/3261>`_).
  296. For example (`godbolt <https://godbolt.org/z/f7bcznb3W>`__):
  297. .. code:: c++
  298. #include <fmt/chrono.h>
  299. int main() {
  300. auto t = std::chrono::system_clock::from_time_t(0) -
  301. std::chrono::milliseconds(250);
  302. fmt::print("{:%S}\n", t); // prints 59.750000000
  303. }
  304. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  305. * Experimental: implemented glibc extension for padding seconds, minutes and
  306. hours (`#2959 <https://github.com/fmtlib/fmt/issues/2959>`_,
  307. `#3271 <https://github.com/fmtlib/fmt/pull/3271>`_).
  308. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  309. * Added a formatter for ``std::exception``
  310. (`#2977 <https://github.com/fmtlib/fmt/issues/2977>`_,
  311. `#3012 <https://github.com/fmtlib/fmt/issues/3012>`_,
  312. `#3062 <https://github.com/fmtlib/fmt/pull/3062>`_,
  313. `#3076 <https://github.com/fmtlib/fmt/pull/3076>`_,
  314. `#3119 <https://github.com/fmtlib/fmt/pull/3119>`_).
  315. For example (`godbolt <https://godbolt.org/z/8xoWGs9e4>`__):
  316. .. code:: c++
  317. #include <fmt/std.h>
  318. #include <vector>
  319. int main() {
  320. try {
  321. std::vector<bool>().at(0);
  322. } catch(const std::exception& e) {
  323. fmt::print("{}", e);
  324. }
  325. }
  326. prints::
  327. vector<bool>::_M_range_check: __n (which is 0) >= this->size() (which is 0)
  328. on libstdc++.
  329. Thanks `@zach2good (Zach Toogood) <https://github.com/zach2good>`_ and
  330. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  331. * Moved ``std::error_code`` formatter from ``fmt/os.h`` to ``fmt/std.h``.
  332. (`#3125 <https://github.com/fmtlib/fmt/pull/3125>`_).
  333. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  334. * Added formatters for standard container adapters: ``std::priority_queue``,
  335. ``std::queue`` and ``std::stack``
  336. (`#3215 <https://github.com/fmtlib/fmt/issues/3215>`_,
  337. `#3279 <https://github.com/fmtlib/fmt/pull/3279>`_).
  338. For example (`godbolt <https://godbolt.org/z/74h1xY9qK>`__):
  339. .. code:: c++
  340. #include <fmt/ranges.h>
  341. #include <stack>
  342. #include <vector>
  343. int main() {
  344. auto s = std::stack<bool, std::vector<bool>>();
  345. for (auto b: {true, false, true}) s.push(b);
  346. fmt::print("{}\n", s); // prints [true, false, true]
  347. }
  348. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  349. * Added a formatter for ``std::optional`` to ``fmt/std.h``.
  350. Thanks `@tom-huntington <https://github.com/tom-huntington>`_.
  351. * Fixed formatting of valueless by exception variants
  352. (`#3347 <https://github.com/fmtlib/fmt/pull/3347>`_).
  353. Thanks `@TheOmegaCarrot <https://github.com/TheOmegaCarrot>`_.
  354. * Made ``fmt::ptr`` accept ``unique_ptr`` with a custom deleter
  355. (`#3177 <https://github.com/fmtlib/fmt/pull/3177>`_).
  356. Thanks `@hmbj (Hans-Martin B. Jensen) <https://github.com/hmbj>`_.
  357. * Fixed formatting of noncopyable ranges and nested ranges of chars
  358. (`#3158 <https://github.com/fmtlib/fmt/pull/3158>`_
  359. `#3286 <https://github.com/fmtlib/fmt/issues/3286>`_,
  360. `#3290 <https://github.com/fmtlib/fmt/pull/3290>`_).
  361. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  362. * Fixed issues with formatting of paths and ranges of paths
  363. (`#3319 <https://github.com/fmtlib/fmt/issues/3319>`_,
  364. `#3321 <https://github.com/fmtlib/fmt/pull/3321>`_
  365. `#3322 <https://github.com/fmtlib/fmt/issues/3322>`_).
  366. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  367. * Improved handling of invalid Unicode in paths.
  368. * Enabled compile-time checks on Apple clang 14 and later
  369. (`#3331 <https://github.com/fmtlib/fmt/pull/3331>`_).
  370. Thanks `@cloyce (Cloyce D. Spradling) <https://github.com/cloyce>`_.
  371. * Improved compile-time checks of named arguments
  372. (`#3105 <https://github.com/fmtlib/fmt/issues/3105>`_,
  373. `#3214 <https://github.com/fmtlib/fmt/pull/3214>`_).
  374. Thanks `@rbrich (Radek Brich) <https://github.com/rbrich>`_.
  375. * Fixed formatting when both alignment and ``0`` are given
  376. (`#3236 <https://github.com/fmtlib/fmt/issues/3236>`_,
  377. `#3248 <https://github.com/fmtlib/fmt/pull/3248>`_).
  378. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  379. * Improved Unicode support in the experimental file API on Windows
  380. (`#3234 <https://github.com/fmtlib/fmt/issues/3234>`_,
  381. `#3293 <https://github.com/fmtlib/fmt/pull/3293>`_).
  382. Thanks `@Fros1er (Froster) <https://github.com/Fros1er>`_.
  383. * Unified UTF transcoding
  384. (`#3416 <https://github.com/fmtlib/fmt/pull/3416>`_).
  385. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  386. * Added support for UTF-8 digit separators via an experimental locale facet
  387. (`#1861 <https://github.com/fmtlib/fmt/issues/1861>`_).
  388. For example (`godbolt <https://godbolt.org/z/f7bcznb3W>`__):
  389. .. code:: c++
  390. auto loc = std::locale(
  391. std::locale(), new fmt::format_facet<std::locale>("’"));
  392. auto s = fmt::format(loc, "{:L}", 1000);
  393. where ``’`` is U+2019 used as a digit separator in the de_CH locale.
  394. * Added an overload of ``formatted_size`` that takes a locale
  395. (`#3084 <https://github.com/fmtlib/fmt/issues/3084>`_,
  396. `#3087 <https://github.com/fmtlib/fmt/pull/3087>`_).
  397. Thanks `@gerboengels <https://github.com/gerboengels>`_.
  398. * Removed the deprecated ``FMT_DEPRECATED_OSTREAM``.
  399. * Fixed a UB when using a null ``std::string_view`` with ``fmt::to_string``
  400. or format string compilation
  401. (`#3241 <https://github.com/fmtlib/fmt/issues/3241>`_,
  402. `#3244 <https://github.com/fmtlib/fmt/pull/3244>`_).
  403. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  404. * Added ``starts_with`` to the fallback ``string_view`` implementation
  405. (`#3080 <https://github.com/fmtlib/fmt/pull/3080>`_).
  406. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  407. * Added ``fmt::basic_format_string::get()`` for compatibility with
  408. ``basic_format_string`` (`#3111 <https://github.com/fmtlib/fmt/pull/3111>`_).
  409. Thanks `@huangqinjin <https://github.com/huangqinjin>`_.
  410. * Added ``println`` for compatibility with C++23
  411. (`#3267 <https://github.com/fmtlib/fmt/pull/3267>`_).
  412. Thanks `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_.
  413. * Renamed the ``FMT_EXPORT`` macro for shared library usage to
  414. ``FMT_LIB_EXPORT``.
  415. * Improved documentation
  416. (`#3108 <https://github.com/fmtlib/fmt/issues/3108>`_,
  417. `#3169 <https://github.com/fmtlib/fmt/issues/3169>`_,
  418. `#3243 <https://github.com/fmtlib/fmt/pull/3243>`_).
  419. `#3404 <https://github.com/fmtlib/fmt/pull/3404>`_).
  420. Thanks `@Cleroth <https://github.com/Cleroth>`_ and
  421. `@Vertexwahn <https://github.com/Vertexwahn>`_.
  422. * Improved build configuration and tests
  423. (`#3118 <https://github.com/fmtlib/fmt/pull/3118>`_,
  424. `#3120 <https://github.com/fmtlib/fmt/pull/3120>`_,
  425. `#3188 <https://github.com/fmtlib/fmt/pull/3188>`_,
  426. `#3189 <https://github.com/fmtlib/fmt/issues/3189>`_,
  427. `#3198 <https://github.com/fmtlib/fmt/pull/3198>`_,
  428. `#3205 <https://github.com/fmtlib/fmt/pull/3205>`_,
  429. `#3207 <https://github.com/fmtlib/fmt/pull/3207>`_,
  430. `#3210 <https://github.com/fmtlib/fmt/pull/3210>`_,
  431. `#3240 <https://github.com/fmtlib/fmt/pull/3240>`_,
  432. `#3256 <https://github.com/fmtlib/fmt/pull/3256>`_,
  433. `#3264 <https://github.com/fmtlib/fmt/pull/3264>`_,
  434. `#3299 <https://github.com/fmtlib/fmt/issues/3299>`_,
  435. `#3302 <https://github.com/fmtlib/fmt/pull/3302>`_,
  436. `#3312 <https://github.com/fmtlib/fmt/pull/3312>`_,
  437. `#3317 <https://github.com/fmtlib/fmt/issues/3317>`_,
  438. `#3328 <https://github.com/fmtlib/fmt/pull/3328>`_,
  439. `#3333 <https://github.com/fmtlib/fmt/pull/3333>`_,
  440. `#3369 <https://github.com/fmtlib/fmt/pull/3369>`_,
  441. `#3373 <https://github.com/fmtlib/fmt/issues/3373>`_,
  442. `#3395 <https://github.com/fmtlib/fmt/pull/3395>`_,
  443. `#3406 <https://github.com/fmtlib/fmt/pull/3406>`_,
  444. `#3411 <https://github.com/fmtlib/fmt/pull/3411>`_).
  445. Thanks `@dimztimz (Dimitrij Mijoski) <https://github.com/dimztimz>`_,
  446. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  447. `@DavidKorczynski <https://github.com/DavidKorczynski>`_,
  448. `@ChrisThrasher (Chris Thrasher) <https://github.com/ChrisThrasher>`_,
  449. `@FrancoisCarouge (François Carouge) <https://github.com/FrancoisCarouge>`_,
  450. `@kennyweiss (Kenny Weiss) <https://github.com/kennyweiss>`_,
  451. `@luzpaz <https://github.com/luzpaz>`_,
  452. `@codeinred (Alecto Irene Perez) <https://github.com/codeinred>`_,
  453. `@Mixaill (Mikhail Paulyshka) <https://github.com/Mixaill>`_,
  454. `@joycebrum (Joyce) <https://github.com/joycebrum>`_,
  455. `@kevinhwang (Kevin Hwang) <https://github.com/kevinhwang>`_,
  456. `@Vertexwahn <https://github.com/Vertexwahn>`_.
  457. * Fixed a regression in handling empty format specifiers after a colon (``{:}``)
  458. (`#3086 <https://github.com/fmtlib/fmt/pull/3086>`_).
  459. Thanks `@oxidase (Michael Krasnyk) <https://github.com/oxidase>`_.
  460. * Worked around a broken implementation of ``std::is_constant_evaluated`` in
  461. some versions of libstdc++ on clang
  462. (`#3247 <https://github.com/fmtlib/fmt/issues/3247>`_,
  463. `#3281 <https://github.com/fmtlib/fmt/pull/3281>`_).
  464. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  465. * Fixed formatting of volatile variables
  466. (`#3068 <https://github.com/fmtlib/fmt/pull/3068>`_).
  467. * Fixed various warnings and compilation issues
  468. (`#3057 <https://github.com/fmtlib/fmt/pull/3057>`_,
  469. `#3066 <https://github.com/fmtlib/fmt/pull/3066>`_,
  470. `#3072 <https://github.com/fmtlib/fmt/pull/3072>`_,
  471. `#3082 <https://github.com/fmtlib/fmt/pull/3082>`_,
  472. `#3091 <https://github.com/fmtlib/fmt/pull/3091>`_,
  473. `#3092 <https://github.com/fmtlib/fmt/issues/3092>`_,
  474. `#3093 <https://github.com/fmtlib/fmt/pull/3093>`_,
  475. `#3095 <https://github.com/fmtlib/fmt/pull/3095>`_,
  476. `#3096 <https://github.com/fmtlib/fmt/issues/3096>`_,
  477. `#3097 <https://github.com/fmtlib/fmt/pull/3097>`_,
  478. `#3128 <https://github.com/fmtlib/fmt/issues/3128>`_,
  479. `#3129 <https://github.com/fmtlib/fmt/pull/3129>`_,
  480. `#3137 <https://github.com/fmtlib/fmt/pull/3137>`_,
  481. `#3139 <https://github.com/fmtlib/fmt/pull/3139>`_,
  482. `#3140 <https://github.com/fmtlib/fmt/issues/3140>`_,
  483. `#3142 <https://github.com/fmtlib/fmt/pull/3142>`_,
  484. `#3149 <https://github.com/fmtlib/fmt/issues/3149>`_,
  485. `#3150 <https://github.com/fmtlib/fmt/pull/3150>`_,
  486. `#3154 <https://github.com/fmtlib/fmt/issues/3154>`_,
  487. `#3163 <https://github.com/fmtlib/fmt/issues/3163>`_,
  488. `#3178 <https://github.com/fmtlib/fmt/issues/3178>`_,
  489. `#3184 <https://github.com/fmtlib/fmt/pull/3184>`_,
  490. `#3196 <https://github.com/fmtlib/fmt/pull/3196>`_,
  491. `#3204 <https://github.com/fmtlib/fmt/issues/3204>`_,
  492. `#3206 <https://github.com/fmtlib/fmt/pull/3206>`_,
  493. `#3208 <https://github.com/fmtlib/fmt/pull/3208>`_,
  494. `#3213 <https://github.com/fmtlib/fmt/issues/3213>`_,
  495. `#3216 <https://github.com/fmtlib/fmt/pull/3216>`_,
  496. `#3224 <https://github.com/fmtlib/fmt/issues/3224>`_,
  497. `#3226 <https://github.com/fmtlib/fmt/issues/3226>`_,
  498. `#3228 <https://github.com/fmtlib/fmt/issues/3228>`_,
  499. `#3229 <https://github.com/fmtlib/fmt/pull/3229>`_,
  500. `#3259 <https://github.com/fmtlib/fmt/pull/3259>`_,
  501. `#3274 <https://github.com/fmtlib/fmt/issues/3274>`_,
  502. `#3287 <https://github.com/fmtlib/fmt/issues/3287>`_,
  503. `#3288 <https://github.com/fmtlib/fmt/pull/3288>`_,
  504. `#3292 <https://github.com/fmtlib/fmt/issues/3292>`_,
  505. `#3295 <https://github.com/fmtlib/fmt/pull/3295>`_,
  506. `#3296 <https://github.com/fmtlib/fmt/pull/3296>`_,
  507. `#3298 <https://github.com/fmtlib/fmt/issues/3298>`_,
  508. `#3325 <https://github.com/fmtlib/fmt/issues/3325>`_,
  509. `#3326 <https://github.com/fmtlib/fmt/pull/3326>`_,
  510. `#3334 <https://github.com/fmtlib/fmt/issues/3334>`_,
  511. `#3342 <https://github.com/fmtlib/fmt/issues/3342>`_,
  512. `#3343 <https://github.com/fmtlib/fmt/pull/3343>`_,
  513. `#3351 <https://github.com/fmtlib/fmt/issues/3351>`_,
  514. `#3352 <https://github.com/fmtlib/fmt/pull/3352>`_,
  515. `#3362 <https://github.com/fmtlib/fmt/pull/3362>`_,
  516. `#3365 <https://github.com/fmtlib/fmt/issues/3365>`_,
  517. `#3366 <https://github.com/fmtlib/fmt/pull/3366>`_,
  518. `#3374 <https://github.com/fmtlib/fmt/pull/3374>`_,
  519. `#3377 <https://github.com/fmtlib/fmt/issues/3377>`_,
  520. `#3378 <https://github.com/fmtlib/fmt/pull/3378>`_,
  521. `#3381 <https://github.com/fmtlib/fmt/issues/3381>`_,
  522. `#3398 <https://github.com/fmtlib/fmt/pull/3398>`_,
  523. `#3413 <https://github.com/fmtlib/fmt/pull/3413>`_,
  524. `#3415 <https://github.com/fmtlib/fmt/issues/3415>`_).
  525. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  526. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  527. `@NewbieOrange <https://github.com/NewbieOrange>`_,
  528. `@EngineLessCC (VivyaCC) <https://github.com/EngineLessCC>`_,
  529. `@asmaloney (Andy Maloney) <https://github.com/asmaloney>`_,
  530. `@HazardyKnusperkeks (Björn Schäpers)
  531. <https://github.com/HazardyKnusperkeks>`_,
  532. `@sergiud (Sergiu Deitsch) <https://github.com/sergiud>`_,
  533. `@Youw (Ihor Dutchak) <https://github.com/Youw>`_,
  534. `@thesmurph <https://github.com/thesmurph>`_,
  535. `@czudziakm (Maksymilian Czudziak) <https://github.com/czudziakm>`_,
  536. `@Roman-Koshelev <https://github.com/Roman-Koshelev>`_,
  537. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  538. `@ShawnZhong (Shawn Zhong) <https://github.com/ShawnZhong>`_,
  539. `@russelltg (Russell Greene) <https://github.com/russelltg>`_,
  540. `@glebm (Gleb Mazovetskiy) <https://github.com/glebm>`_,
  541. `@tmartin-gh <https://github.com/tmartin-gh>`_,
  542. `@Zhaojun-Liu (June Liu) <https://github.com/Zhaojun-Liu>`_,
  543. `@louiswins (Louis Wilson) <https://github.com/louiswins>`_,
  544. `@mogemimi <https://github.com/mogemimi>`_.
  545. 9.1.0 - 2022-08-27
  546. ------------------
  547. * ``fmt::formatted_size`` now works at compile time
  548. (`#3026 <https://github.com/fmtlib/fmt/pull/3026>`_). For example
  549. (`godbolt <https://godbolt.org/z/1MW5rMdf8>`__):
  550. .. code:: c++
  551. #include <fmt/compile.h>
  552. int main() {
  553. using namespace fmt::literals;
  554. constexpr size_t n = fmt::formatted_size("{}"_cf, 42);
  555. fmt::print("{}\n", n); // prints 2
  556. }
  557. Thanks `@marksantaniello (Mark Santaniello)
  558. <https://github.com/marksantaniello>`_.
  559. * Fixed handling of invalid UTF-8
  560. (`#3038 <https://github.com/fmtlib/fmt/pull/3038>`_,
  561. `#3044 <https://github.com/fmtlib/fmt/pull/3044>`_,
  562. `#3056 <https://github.com/fmtlib/fmt/pull/3056>`_).
  563. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_ and
  564. `@skeeto (Christopher Wellons) <https://github.com/skeeto>`_.
  565. * Improved Unicode support in ``ostream`` overloads of ``print``
  566. (`#2994 <https://github.com/fmtlib/fmt/pull/2994>`_,
  567. `#3001 <https://github.com/fmtlib/fmt/pull/3001>`_,
  568. `#3025 <https://github.com/fmtlib/fmt/pull/3025>`_).
  569. Thanks `@dimztimz (Dimitrij Mijoski) <https://github.com/dimztimz>`_.
  570. * Fixed handling of the sign specifier in localized formatting on systems with
  571. 32-bit ``wchar_t`` (`#3041 <https://github.com/fmtlib/fmt/issues/3041>`_).
  572. * Added support for wide streams to ``fmt::streamed``
  573. (`#2994 <https://github.com/fmtlib/fmt/pull/2994>`_).
  574. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  575. * Added the ``n`` specifier that disables the output of delimiters when
  576. formatting ranges (`#2981 <https://github.com/fmtlib/fmt/pull/2981>`_,
  577. `#2983 <https://github.com/fmtlib/fmt/pull/2983>`_).
  578. For example (`godbolt <https://godbolt.org/z/roKqGdj8c>`__):
  579. .. code:: c++
  580. #include <fmt/ranges.h>
  581. #include <vector>
  582. int main() {
  583. auto v = std::vector{1, 2, 3};
  584. fmt::print("{:n}\n", v); // prints 1, 2, 3
  585. }
  586. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  587. * Worked around problematic ``std::string_view`` constructors introduced in
  588. C++23 (`#3030 <https://github.com/fmtlib/fmt/issues/3030>`_,
  589. `#3050 <https://github.com/fmtlib/fmt/issues/3050>`_).
  590. Thanks `@strega-nil-ms (nicole mazzuca) <https://github.com/strega-nil-ms>`_.
  591. * Improve handling (exclusion) of recursive ranges
  592. (`#2968 <https://github.com/fmtlib/fmt/issues/2968>`_,
  593. `#2974 <https://github.com/fmtlib/fmt/pull/2974>`_).
  594. Thanks `@Dani-Hub (Daniel Krügler) <https://github.com/Dani-Hub>`_.
  595. * Improved error reporting in format string compilation
  596. (`#3055 <https://github.com/fmtlib/fmt/issues/3055>`_).
  597. * Improved the implementation of
  598. `Dragonbox <https://github.com/jk-jeon/dragonbox>`_, the algorithm used for
  599. the default floating-point formatting
  600. (`#2984 <https://github.com/fmtlib/fmt/pull/2984>`_).
  601. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  602. * Fixed issues with floating-point formatting on exotic platforms.
  603. * Improved the implementation of chrono formatting
  604. (`#3010 <https://github.com/fmtlib/fmt/pull/3010>`_).
  605. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  606. * Improved documentation
  607. (`#2966 <https://github.com/fmtlib/fmt/pull/2966>`_,
  608. `#3009 <https://github.com/fmtlib/fmt/pull/3009>`_,
  609. `#3020 <https://github.com/fmtlib/fmt/issues/3020>`_,
  610. `#3037 <https://github.com/fmtlib/fmt/pull/3037>`_).
  611. Thanks `@mwinterb <https://github.com/mwinterb>`_,
  612. `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_
  613. and `@remiburtin (Rémi Burtin) <https://github.com/remiburtin>`_.
  614. * Improved build configuration
  615. (`#2991 <https://github.com/fmtlib/fmt/pull/2991>`_,
  616. `#2995 <https://github.com/fmtlib/fmt/pull/2995>`_,
  617. `#3004 <https://github.com/fmtlib/fmt/issues/3004>`_,
  618. `#3007 <https://github.com/fmtlib/fmt/pull/3007>`_,
  619. `#3040 <https://github.com/fmtlib/fmt/pull/3040>`_).
  620. Thanks `@dimztimz (Dimitrij Mijoski) <https://github.com/dimztimz>`_ and
  621. `@hwhsu1231 (Haowei Hsu) <https://github.com/hwhsu1231>`_.
  622. * Fixed various warnings and compilation issues
  623. (`#2969 <https://github.com/fmtlib/fmt/issues/2969>`_,
  624. `#2971 <https://github.com/fmtlib/fmt/pull/2971>`_,
  625. `#2975 <https://github.com/fmtlib/fmt/issues/2975>`_,
  626. `#2982 <https://github.com/fmtlib/fmt/pull/2982>`_,
  627. `#2985 <https://github.com/fmtlib/fmt/pull/2985>`_,
  628. `#2988 <https://github.com/fmtlib/fmt/issues/2988>`_,
  629. `#2989 <https://github.com/fmtlib/fmt/issues/2989>`_,
  630. `#3000 <https://github.com/fmtlib/fmt/issues/3000>`_,
  631. `#3006 <https://github.com/fmtlib/fmt/issues/3006>`_,
  632. `#3014 <https://github.com/fmtlib/fmt/issues/3014>`_,
  633. `#3015 <https://github.com/fmtlib/fmt/issues/3015>`_,
  634. `#3021 <https://github.com/fmtlib/fmt/pull/3021>`_,
  635. `#3023 <https://github.com/fmtlib/fmt/issues/3023>`_,
  636. `#3024 <https://github.com/fmtlib/fmt/pull/3024>`_,
  637. `#3029 <https://github.com/fmtlib/fmt/pull/3029>`_,
  638. `#3043 <https://github.com/fmtlib/fmt/pull/3043>`_,
  639. `#3052 <https://github.com/fmtlib/fmt/issues/3052>`_,
  640. `#3053 <https://github.com/fmtlib/fmt/pull/3053>`_,
  641. `#3054 <https://github.com/fmtlib/fmt/pull/3054>`_).
  642. Thanks `@h-friederich (Hannes Friederich) <https://github.com/h-friederich>`_,
  643. `@dimztimz (Dimitrij Mijoski) <https://github.com/dimztimz>`_,
  644. `@olupton (Olli Lupton) <https://github.com/olupton>`_,
  645. `@bernhardmgruber (Bernhard Manfred Gruber)
  646. <https://github.com/bernhardmgruber>`_,
  647. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  648. 9.0.0 - 2022-07-04
  649. ------------------
  650. * Switched to the internal floating point formatter for all decimal presentation
  651. formats. In particular this results in consistent rounding on all platforms
  652. and removing the ``s[n]printf`` fallback for decimal FP formatting.
  653. * Compile-time floating point formatting no longer requires the header-only
  654. mode. For example (`godbolt <https://godbolt.org/z/G37PTeG3b>`__):
  655. .. code:: c++
  656. #include <array>
  657. #include <fmt/compile.h>
  658. consteval auto compile_time_dtoa(double value) -> std::array<char, 10> {
  659. auto result = std::array<char, 10>();
  660. fmt::format_to(result.data(), FMT_COMPILE("{}"), value);
  661. return result;
  662. }
  663. constexpr auto answer = compile_time_dtoa(0.42);
  664. works with the default settings.
  665. * Improved the implementation of
  666. `Dragonbox <https://github.com/jk-jeon/dragonbox>`_, the algorithm used for
  667. the default floating-point formatting
  668. (`#2713 <https://github.com/fmtlib/fmt/pull/2713>`_,
  669. `#2750 <https://github.com/fmtlib/fmt/pull/2750>`_).
  670. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  671. * Made ``fmt::to_string`` work with ``__float128``. This uses the internal
  672. FP formatter and works even on system without ``__float128`` support in
  673. ``[s]printf``.
  674. * Disabled automatic ``std::ostream`` insertion operator (``operator<<``)
  675. discovery when ``fmt/ostream.h`` is included to prevent ODR violations.
  676. You can get the old behavior by defining ``FMT_DEPRECATED_OSTREAM`` but this
  677. will be removed in the next major release. Use ``fmt::streamed`` or
  678. ``fmt::ostream_formatter`` to enable formatting via ``std::ostream`` instead.
  679. * Added ``fmt::ostream_formatter`` that can be used to write ``formatter``
  680. specializations that perform formatting via ``std::ostream``.
  681. For example (`godbolt <https://godbolt.org/z/5sEc5qMsf>`__):
  682. .. code:: c++
  683. #include <fmt/ostream.h>
  684. struct date {
  685. int year, month, day;
  686. friend std::ostream& operator<<(std::ostream& os, const date& d) {
  687. return os << d.year << '-' << d.month << '-' << d.day;
  688. }
  689. };
  690. template <> struct fmt::formatter<date> : ostream_formatter {};
  691. std::string s = fmt::format("The date is {}", date{2012, 12, 9});
  692. // s == "The date is 2012-12-9"
  693. * Added the ``fmt::streamed`` function that takes an object and formats it
  694. via ``std::ostream``.
  695. For example (`godbolt <https://godbolt.org/z/5G3346G1f>`__):
  696. .. code:: c++
  697. #include <thread>
  698. #include <fmt/ostream.h>
  699. int main() {
  700. fmt::print("Current thread id: {}\n",
  701. fmt::streamed(std::this_thread::get_id()));
  702. }
  703. Note that ``fmt/std.h`` provides a ``formatter`` specialization for
  704. ``std::thread::id`` so you don't need to format it via ``std::ostream``.
  705. * Deprecated implicit conversions of unscoped enums to integers for consistency
  706. with scoped enums.
  707. * Added an argument-dependent lookup based ``format_as`` extension API to
  708. simplify formatting of enums.
  709. * Added experimental ``std::variant`` formatting support
  710. (`#2941 <https://github.com/fmtlib/fmt/pull/2941>`_).
  711. For example (`godbolt <https://godbolt.org/z/KG9z6cq68>`__):
  712. .. code:: c++
  713. #include <variant>
  714. #include <fmt/std.h>
  715. int main() {
  716. auto v = std::variant<int, std::string>(42);
  717. fmt::print("{}\n", v);
  718. }
  719. prints::
  720. variant(42)
  721. Thanks `@jehelset <https://github.com/jehelset>`_.
  722. * Added experimental ``std::filesystem::path`` formatting support
  723. (`#2865 <https://github.com/fmtlib/fmt/issues/2865>`_,
  724. `#2902 <https://github.com/fmtlib/fmt/pull/2902>`_,
  725. `#2917 <https://github.com/fmtlib/fmt/issues/2917>`_,
  726. `#2918 <https://github.com/fmtlib/fmt/pull/2918>`_).
  727. For example (`godbolt <https://godbolt.org/z/o44dMexEb>`__):
  728. .. code:: c++
  729. #include <filesystem>
  730. #include <fmt/std.h>
  731. int main() {
  732. fmt::print("There is no place like {}.", std::filesystem::path("/home"));
  733. }
  734. prints::
  735. There is no place like "/home".
  736. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  737. * Added a ``std::thread::id`` formatter to ``fmt/std.h``.
  738. For example (`godbolt <https://godbolt.org/z/j1azbYf3E>`__):
  739. .. code:: c++
  740. #include <thread>
  741. #include <fmt/std.h>
  742. int main() {
  743. fmt::print("Current thread id: {}\n", std::this_thread::get_id());
  744. }
  745. * Added ``fmt::styled`` that applies a text style to an individual argument
  746. (`#2793 <https://github.com/fmtlib/fmt/pull/2793>`_).
  747. For example (`godbolt <https://godbolt.org/z/vWGW7v5M6>`__):
  748. .. code:: c++
  749. #include <fmt/chrono.h>
  750. #include <fmt/color.h>
  751. int main() {
  752. auto now = std::chrono::system_clock::now();
  753. fmt::print(
  754. "[{}] {}: {}\n",
  755. fmt::styled(now, fmt::emphasis::bold),
  756. fmt::styled("error", fg(fmt::color::red)),
  757. "something went wrong");
  758. }
  759. prints
  760. .. image:: https://user-images.githubusercontent.com/576385/
  761. 175071215-12809244-dab0-4005-96d8-7cd911c964d5.png
  762. Thanks `@rbrugo (Riccardo Brugo) <https://github.com/rbrugo>`_.
  763. * Made ``fmt::print`` overload for text styles correctly handle UTF-8
  764. (`#2681 <https://github.com/fmtlib/fmt/issues/2681>`_,
  765. `#2701 <https://github.com/fmtlib/fmt/pull/2701>`_).
  766. Thanks `@AlexGuteniev (Alex Guteniev) <https://github.com/AlexGuteniev>`_.
  767. * Fixed Unicode handling when writing to an ostream.
  768. * Added support for nested specifiers to range formatting
  769. (`#2673 <https://github.com/fmtlib/fmt/pull/2673>`_).
  770. For example (`godbolt <https://godbolt.org/z/xd3Gj38cf>`__):
  771. .. code:: c++
  772. #include <vector>
  773. #include <fmt/ranges.h>
  774. int main() {
  775. fmt::print("{::#x}\n", std::vector{10, 20, 30});
  776. }
  777. prints ``[0xa, 0x14, 0x1e]``.
  778. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  779. * Implemented escaping of wide strings in ranges
  780. (`#2904 <https://github.com/fmtlib/fmt/pull/2904>`_).
  781. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  782. * Added support for ranges with ``begin`` / ``end`` found via the
  783. argument-dependent lookup
  784. (`#2807 <https://github.com/fmtlib/fmt/pull/2807>`_).
  785. Thanks `@rbrugo (Riccardo Brugo) <https://github.com/rbrugo>`_.
  786. * Fixed formatting of certain kinds of ranges of ranges
  787. (`#2787 <https://github.com/fmtlib/fmt/pull/2787>`_).
  788. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  789. * Fixed handling of maps with element types other than ``std::pair``
  790. (`#2944 <https://github.com/fmtlib/fmt/pull/2944>`_).
  791. Thanks `@BrukerJWD (Jonathan W) <https://github.com/BrukerJWD>`_.
  792. * Made tuple formatter enabled only if elements are formattable
  793. (`#2939 <https://github.com/fmtlib/fmt/issues/2939>`_,
  794. `#2940 <https://github.com/fmtlib/fmt/pull/2940>`_).
  795. Thanks `@jehelset <https://github.com/jehelset>`_.
  796. * Made ``fmt::join`` compatible with format string compilation
  797. (`#2719 <https://github.com/fmtlib/fmt/issues/2719>`_,
  798. `#2720 <https://github.com/fmtlib/fmt/pull/2720>`_).
  799. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  800. * Made compile-time checks work with named arguments of custom types and
  801. ``std::ostream`` ``print`` overloads
  802. (`#2816 <https://github.com/fmtlib/fmt/issues/2816>`_,
  803. `#2817 <https://github.com/fmtlib/fmt/issues/2817>`_,
  804. `#2819 <https://github.com/fmtlib/fmt/pull/2819>`_).
  805. Thanks `@timsong-cpp <https://github.com/timsong-cpp>`_.
  806. * Removed ``make_args_checked`` because it is no longer needed for compile-time
  807. checks (`#2760 <https://github.com/fmtlib/fmt/pull/2760>`_).
  808. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  809. * Removed the following deprecated APIs: ``_format``, ``arg_join``,
  810. the ``format_to`` overload that takes a memory buffer,
  811. ``[v]fprintf`` that takes an ``ostream``.
  812. * Removed the deprecated implicit conversion of ``[const] signed char*`` and
  813. ``[const] unsigned char*`` to C strings.
  814. * Removed the deprecated ``fmt/locale.h``.
  815. * Replaced the deprecated ``fileno()`` with ``descriptor()`` in
  816. ``buffered_file``.
  817. * Moved ``to_string_view`` to the ``detail`` namespace since it's an
  818. implementation detail.
  819. * Made access mode of a created file consistent with ``fopen`` by setting
  820. ``S_IWGRP`` and ``S_IWOTH``
  821. (`#2733 <https://github.com/fmtlib/fmt/pull/2733>`_).
  822. Thanks `@arogge (Andreas Rogge) <https://github.com/arogge>`_.
  823. * Removed a redundant buffer resize when formatting to ``std::ostream``
  824. (`#2842 <https://github.com/fmtlib/fmt/issues/2842>`_,
  825. `#2843 <https://github.com/fmtlib/fmt/pull/2843>`_).
  826. Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_.
  827. * Made precision computation for strings consistent with width
  828. (`#2888 <https://github.com/fmtlib/fmt/issues/2888>`_).
  829. * Fixed handling of locale separators in floating point formatting
  830. (`#2830 <https://github.com/fmtlib/fmt/issues/2830>`_).
  831. * Made sign specifiers work with ``__int128_t``
  832. (`#2773 <https://github.com/fmtlib/fmt/issues/2773>`_).
  833. * Improved support for systems such as CHERI with extra data stored in pointers
  834. (`#2932 <https://github.com/fmtlib/fmt/pull/2932>`_).
  835. Thanks `@davidchisnall (David Chisnall) <https://github.com/davidchisnall>`_.
  836. * Improved documentation
  837. (`#2706 <https://github.com/fmtlib/fmt/pull/2706>`_,
  838. `#2712 <https://github.com/fmtlib/fmt/pull/2712>`_,
  839. `#2789 <https://github.com/fmtlib/fmt/pull/2789>`_,
  840. `#2803 <https://github.com/fmtlib/fmt/pull/2803>`_,
  841. `#2805 <https://github.com/fmtlib/fmt/pull/2805>`_,
  842. `#2815 <https://github.com/fmtlib/fmt/pull/2815>`_,
  843. `#2924 <https://github.com/fmtlib/fmt/pull/2924>`_).
  844. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_,
  845. `@Pokechu22 <https://github.com/Pokechu22>`_,
  846. `@setoye (Alta) <https://github.com/setoye>`_,
  847. `@rtobar <https://github.com/rtobar>`_,
  848. `@rbrugo (Riccardo Brugo) <https://github.com/rbrugo>`_,
  849. `@anoonD (cre) <https://github.com/anoonD>`_,
  850. `@leha-bot (Alex) <https://github.com/leha-bot>`_.
  851. * Improved build configuration
  852. (`#2766 <https://github.com/fmtlib/fmt/pull/2766>`_,
  853. `#2772 <https://github.com/fmtlib/fmt/pull/2772>`_,
  854. `#2836 <https://github.com/fmtlib/fmt/pull/2836>`_,
  855. `#2852 <https://github.com/fmtlib/fmt/pull/2852>`_,
  856. `#2907 <https://github.com/fmtlib/fmt/pull/2907>`_,
  857. `#2913 <https://github.com/fmtlib/fmt/pull/2913>`_,
  858. `#2914 <https://github.com/fmtlib/fmt/pull/2914>`_).
  859. Thanks `@kambala-decapitator (Andrey Filipenkov)
  860. <https://github.com/kambala-decapitator>`_,
  861. `@mattiasljungstrom (Mattias Ljungström)
  862. <https://github.com/mattiasljungstrom>`_,
  863. `@kieselnb (Nick Kiesel) <https://github.com/kieselnb>`_,
  864. `@nathannaveen <https://github.com/nathannaveen>`_,
  865. `@Vertexwahn <https://github.com/Vertexwahn>`_.
  866. * Fixed various warnings and compilation issues
  867. (`#2408 <https://github.com/fmtlib/fmt/issues/2408>`_,
  868. `#2507 <https://github.com/fmtlib/fmt/issues/2507>`_,
  869. `#2697 <https://github.com/fmtlib/fmt/issues/2697>`_,
  870. `#2715 <https://github.com/fmtlib/fmt/issues/2715>`_,
  871. `#2717 <https://github.com/fmtlib/fmt/issues/2717>`_,
  872. `#2722 <https://github.com/fmtlib/fmt/pull/2722>`_,
  873. `#2724 <https://github.com/fmtlib/fmt/pull/2724>`_,
  874. `#2725 <https://github.com/fmtlib/fmt/pull/2725>`_,
  875. `#2726 <https://github.com/fmtlib/fmt/issues/2726>`_,
  876. `#2728 <https://github.com/fmtlib/fmt/pull/2728>`_,
  877. `#2732 <https://github.com/fmtlib/fmt/pull/2732>`_,
  878. `#2738 <https://github.com/fmtlib/fmt/issues/2738>`_,
  879. `#2742 <https://github.com/fmtlib/fmt/pull/2742>`_,
  880. `#2744 <https://github.com/fmtlib/fmt/issues/2744>`_,
  881. `#2745 <https://github.com/fmtlib/fmt/issues/2745>`_,
  882. `#2746 <https://github.com/fmtlib/fmt/issues/2746>`_,
  883. `#2754 <https://github.com/fmtlib/fmt/issues/2754>`_,
  884. `#2755 <https://github.com/fmtlib/fmt/pull/2755>`_,
  885. `#2757 <https://github.com/fmtlib/fmt/issues/2757>`_,
  886. `#2758 <https://github.com/fmtlib/fmt/pull/2758>`_,
  887. `#2761 <https://github.com/fmtlib/fmt/issues/2761>`_,
  888. `#2762 <https://github.com/fmtlib/fmt/pull/2762>`_,
  889. `#2763 <https://github.com/fmtlib/fmt/issues/2763>`_,
  890. `#2765 <https://github.com/fmtlib/fmt/pull/2765>`_,
  891. `#2769 <https://github.com/fmtlib/fmt/issues/2769>`_,
  892. `#2770 <https://github.com/fmtlib/fmt/pull/2770>`_,
  893. `#2771 <https://github.com/fmtlib/fmt/issues/2771>`_,
  894. `#2777 <https://github.com/fmtlib/fmt/issues/2777>`_,
  895. `#2779 <https://github.com/fmtlib/fmt/pull/2779>`_,
  896. `#2782 <https://github.com/fmtlib/fmt/pull/2782>`_,
  897. `#2783 <https://github.com/fmtlib/fmt/pull/2783>`_,
  898. `#2794 <https://github.com/fmtlib/fmt/issues/2794>`_,
  899. `#2796 <https://github.com/fmtlib/fmt/issues/2796>`_,
  900. `#2797 <https://github.com/fmtlib/fmt/pull/2797>`_,
  901. `#2801 <https://github.com/fmtlib/fmt/pull/2801>`_,
  902. `#2802 <https://github.com/fmtlib/fmt/pull/2802>`_,
  903. `#2808 <https://github.com/fmtlib/fmt/issues/2808>`_,
  904. `#2818 <https://github.com/fmtlib/fmt/issues/2818>`_,
  905. `#2819 <https://github.com/fmtlib/fmt/pull/2819>`_,
  906. `#2829 <https://github.com/fmtlib/fmt/issues/2829>`_,
  907. `#2835 <https://github.com/fmtlib/fmt/issues/2835>`_,
  908. `#2848 <https://github.com/fmtlib/fmt/issues/2848>`_,
  909. `#2860 <https://github.com/fmtlib/fmt/issues/2860>`_,
  910. `#2861 <https://github.com/fmtlib/fmt/pull/2861>`_,
  911. `#2882 <https://github.com/fmtlib/fmt/pull/2882>`_,
  912. `#2886 <https://github.com/fmtlib/fmt/issues/2886>`_,
  913. `#2891 <https://github.com/fmtlib/fmt/issues/2891>`_,
  914. `#2892 <https://github.com/fmtlib/fmt/pull/2892>`_,
  915. `#2895 <https://github.com/fmtlib/fmt/issues/2895>`_,
  916. `#2896 <https://github.com/fmtlib/fmt/issues/2896>`_,
  917. `#2903 <https://github.com/fmtlib/fmt/pull/2903>`_,
  918. `#2906 <https://github.com/fmtlib/fmt/issues/2906>`_,
  919. `#2908 <https://github.com/fmtlib/fmt/issues/2908>`_,
  920. `#2909 <https://github.com/fmtlib/fmt/pull/2909>`_,
  921. `#2920 <https://github.com/fmtlib/fmt/issues/2920>`_,
  922. `#2922 <https://github.com/fmtlib/fmt/pull/2922>`_,
  923. `#2927 <https://github.com/fmtlib/fmt/pull/2927>`_,
  924. `#2929 <https://github.com/fmtlib/fmt/pull/2929>`_,
  925. `#2936 <https://github.com/fmtlib/fmt/issues/2936>`_,
  926. `#2937 <https://github.com/fmtlib/fmt/pull/2937>`_,
  927. `#2938 <https://github.com/fmtlib/fmt/pull/2938>`_,
  928. `#2951 <https://github.com/fmtlib/fmt/pull/2951>`_,
  929. `#2954 <https://github.com/fmtlib/fmt/issues/2954>`_,
  930. `#2957 <https://github.com/fmtlib/fmt/pull/2957>`_,
  931. `#2958 <https://github.com/fmtlib/fmt/issues/2958>`_,
  932. `#2960 <https://github.com/fmtlib/fmt/pull/2960>`_).
  933. Thanks `@matrackif <https://github.com/matrackif>`_
  934. `@Tobi823 (Tobias Hellmann) <https://github.com/Tobi823>`_,
  935. `@ivan-volnov (Ivan Volnov) <https://github.com/ivan-volnov>`_,
  936. `@VasiliPupkin256 <https://github.com/VasiliPupkin256>`_,
  937. `@federico-busato (Federico) <https://github.com/federico-busato>`_,
  938. `@barcharcraz (Charlie Barto) <https://github.com/barcharcraz>`_,
  939. `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_,
  940. `@HazardyKnusperkeks (Björn Schäpers)
  941. <https://github.com/HazardyKnusperkeks>`_,
  942. `@dalboris (Boris Dalstein) <https://github.com/dalboris>`_,
  943. `@seanm (Sean McBride) <https://github.com/seanm>`_,
  944. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  945. `@timsong-cpp <https://github.com/timsong-cpp>`_,
  946. `@seanm (Sean McBride) <https://github.com/seanm>`_,
  947. `@frithrah <https://github.com/frithrah>`_,
  948. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  949. `@Agga <https://github.com/Agga>`_,
  950. `@madmaxoft (Mattes D) <https://github.com/madmaxoft>`_,
  951. `@JurajX (Juraj) <https://github.com/JurajX>`_,
  952. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  953. `@Dani-Hub (Daniel Krügler) <https://github.com/Dani-Hub>`_.
  954. 8.1.1 - 2022-01-06
  955. ------------------
  956. * Restored ABI compatibility with version 8.0.x
  957. (`#2695 <https://github.com/fmtlib/fmt/issues/2695>`_,
  958. `#2696 <https://github.com/fmtlib/fmt/pull/2696>`_).
  959. Thanks `@saraedum (Julian Rüth) <https://github.com/saraedum>`_.
  960. * Fixed chrono formatting on big endian systems
  961. (`#2698 <https://github.com/fmtlib/fmt/issues/2698>`_,
  962. `#2699 <https://github.com/fmtlib/fmt/pull/2699>`_).
  963. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_ and
  964. `@xvitaly (Vitaly Zaitsev) <https://github.com/xvitaly>`_.
  965. * Fixed a linkage error with mingw
  966. (`#2691 <https://github.com/fmtlib/fmt/issues/2691>`_,
  967. `#2692 <https://github.com/fmtlib/fmt/pull/2692>`_).
  968. Thanks `@rbberger (Richard Berger) <https://github.com/rbberger>`_.
  969. 8.1.0 - 2022-01-02
  970. ------------------
  971. * Optimized chrono formatting
  972. (`#2500 <https://github.com/fmtlib/fmt/pull/2500>`_,
  973. `#2537 <https://github.com/fmtlib/fmt/pull/2537>`_,
  974. `#2541 <https://github.com/fmtlib/fmt/issues/2541>`_,
  975. `#2544 <https://github.com/fmtlib/fmt/pull/2544>`_,
  976. `#2550 <https://github.com/fmtlib/fmt/pull/2550>`_,
  977. `#2551 <https://github.com/fmtlib/fmt/pull/2551>`_,
  978. `#2576 <https://github.com/fmtlib/fmt/pull/2576>`_,
  979. `#2577 <https://github.com/fmtlib/fmt/issues/2577>`_,
  980. `#2586 <https://github.com/fmtlib/fmt/pull/2586>`_,
  981. `#2591 <https://github.com/fmtlib/fmt/pull/2591>`_,
  982. `#2594 <https://github.com/fmtlib/fmt/pull/2594>`_,
  983. `#2602 <https://github.com/fmtlib/fmt/pull/2602>`_,
  984. `#2617 <https://github.com/fmtlib/fmt/pull/2617>`_,
  985. `#2628 <https://github.com/fmtlib/fmt/issues/2628>`_,
  986. `#2633 <https://github.com/fmtlib/fmt/pull/2633>`_,
  987. `#2670 <https://github.com/fmtlib/fmt/issues/2670>`_,
  988. `#2671 <https://github.com/fmtlib/fmt/pull/2671>`_).
  989. Processing of some specifiers such as ``%z`` and ``%Y`` is now up to 10-20
  990. times faster, for example on GCC 11 with libstdc++::
  991. ----------------------------------------------------------------------------
  992. Benchmark Before After
  993. ----------------------------------------------------------------------------
  994. FMTFormatter_z 261 ns 26.3 ns
  995. FMTFormatterCompile_z 246 ns 11.6 ns
  996. FMTFormatter_Y 263 ns 26.1 ns
  997. FMTFormatterCompile_Y 244 ns 10.5 ns
  998. ----------------------------------------------------------------------------
  999. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_ and
  1000. `@toughengineer (Pavel Novikov) <https://github.com/toughengineer>`_.
  1001. * Implemented subsecond formatting for chrono durations
  1002. (`#2623 <https://github.com/fmtlib/fmt/pull/2623>`_).
  1003. For example (`godbolt <https://godbolt.org/z/es7vWTETe>`__):
  1004. .. code:: c++
  1005. #include <fmt/chrono.h>
  1006. int main() {
  1007. fmt::print("{:%S}", std::chrono::milliseconds(1234));
  1008. }
  1009. prints "01.234".
  1010. Thanks `@matrackif <https://github.com/matrackif>`_.
  1011. * Fixed handling of precision 0 when formatting chrono durations
  1012. (`#2587 <https://github.com/fmtlib/fmt/issues/2587>`_,
  1013. `#2588 <https://github.com/fmtlib/fmt/pull/2588>`_).
  1014. Thanks `@lukester1975 <https://github.com/lukester1975>`_.
  1015. * Fixed an overflow on invalid inputs in the ``tm`` formatter
  1016. (`#2564 <https://github.com/fmtlib/fmt/pull/2564>`_).
  1017. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1018. * Added ``fmt::group_digits`` that formats integers with a non-localized digit
  1019. separator (comma) for groups of three digits.
  1020. For example (`godbolt <https://godbolt.org/z/TxGxG9Poq>`__):
  1021. .. code:: c++
  1022. #include <fmt/format.h>
  1023. int main() {
  1024. fmt::print("{} dollars", fmt::group_digits(1000000));
  1025. }
  1026. prints "1,000,000 dollars".
  1027. * Added support for faint, conceal, reverse and blink text styles
  1028. (`#2394 <https://github.com/fmtlib/fmt/pull/2394>`_):
  1029. https://user-images.githubusercontent.com/576385/147710227-c68f5317-f8fa-42c3-9123-7c4ba3c398cb.mp4
  1030. Thanks `@benit8 (Benoît Lormeau) <https://github.com/benit8>`_ and
  1031. `@data-man (Dmitry Atamanov) <https://github.com/data-man>`_.
  1032. * Added experimental support for compile-time floating point formatting
  1033. (`#2426 <https://github.com/fmtlib/fmt/pull/2426>`_,
  1034. `#2470 <https://github.com/fmtlib/fmt/pull/2470>`_).
  1035. It is currently limited to the header-only mode.
  1036. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1037. * Added UDL-based named argument support to compile-time format string checks
  1038. (`#2640 <https://github.com/fmtlib/fmt/issues/2640>`_,
  1039. `#2649 <https://github.com/fmtlib/fmt/pull/2649>`_).
  1040. For example (`godbolt <https://godbolt.org/z/ohGbbvonv>`__):
  1041. .. code:: c++
  1042. #include <fmt/format.h>
  1043. int main() {
  1044. using namespace fmt::literals;
  1045. fmt::print("{answer:s}", "answer"_a=42);
  1046. }
  1047. gives a compile-time error on compilers with C++20 ``consteval`` and non-type
  1048. template parameter support (gcc 10+) because ``s`` is not a valid format
  1049. specifier for an integer.
  1050. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1051. * Implemented escaping of string range elements.
  1052. For example (`godbolt <https://godbolt.org/z/rKvM1vKf3>`__):
  1053. .. code:: c++
  1054. #include <fmt/ranges.h>
  1055. #include <vector>
  1056. int main() {
  1057. fmt::print("{}", std::vector<std::string>{"\naan"});
  1058. }
  1059. is now printed as::
  1060. ["\naan"]
  1061. instead of::
  1062. ["
  1063. aan"]
  1064. * Added an experimental ``?`` specifier for escaping strings.
  1065. (`#2674 <https://github.com/fmtlib/fmt/pull/2674>`_).
  1066. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  1067. * Switched to JSON-like representation of maps and sets for consistency with
  1068. Python's ``str.format``.
  1069. For example (`godbolt <https://godbolt.org/z/seKjoY9W5>`__):
  1070. .. code:: c++
  1071. #include <fmt/ranges.h>
  1072. #include <map>
  1073. int main() {
  1074. fmt::print("{}", std::map<std::string, int>{{"answer", 42}});
  1075. }
  1076. is now printed as::
  1077. {"answer": 42}
  1078. * Extended ``fmt::join`` to support C++20-only ranges
  1079. (`#2549 <https://github.com/fmtlib/fmt/pull/2549>`_).
  1080. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  1081. * Optimized handling of non-const-iterable ranges and implemented initial
  1082. support for non-const-formattable types.
  1083. * Disabled implicit conversions of scoped enums to integers that was
  1084. accidentally introduced in earlier versions
  1085. (`#1841 <https://github.com/fmtlib/fmt/pull/1841>`_).
  1086. * Deprecated implicit conversion of ``[const] signed char*`` and
  1087. ``[const] unsigned char*`` to C strings.
  1088. * Deprecated ``_format``, a legacy UDL-based format API
  1089. (`#2646 <https://github.com/fmtlib/fmt/pull/2646>`_).
  1090. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1091. * Marked ``format``, ``formatted_size`` and ``to_string`` as ``[[nodiscard]]``
  1092. (`#2612 <https://github.com/fmtlib/fmt/pull/2612>`_).
  1093. `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_.
  1094. * Added missing diagnostic when trying to format function and member pointers
  1095. as well as objects convertible to pointers which is explicitly disallowed
  1096. (`#2598 <https://github.com/fmtlib/fmt/issues/2598>`_,
  1097. `#2609 <https://github.com/fmtlib/fmt/pull/2609>`_,
  1098. `#2610 <https://github.com/fmtlib/fmt/pull/2610>`_).
  1099. Thanks `@AlexGuteniev (Alex Guteniev) <https://github.com/AlexGuteniev>`_.
  1100. * Optimized writing to a contiguous buffer with ``format_to_n``
  1101. (`#2489 <https://github.com/fmtlib/fmt/pull/2489>`_).
  1102. Thanks `@Roman-Koshelev <https://github.com/Roman-Koshelev>`_.
  1103. * Optimized writing to non-``char`` buffers
  1104. (`#2477 <https://github.com/fmtlib/fmt/pull/2477>`_).
  1105. Thanks `@Roman-Koshelev <https://github.com/Roman-Koshelev>`_.
  1106. * Decimal point is now localized when using the ``L`` specifier.
  1107. * Improved floating point formatter implementation
  1108. (`#2498 <https://github.com/fmtlib/fmt/pull/2498>`_,
  1109. `#2499 <https://github.com/fmtlib/fmt/pull/2499>`_).
  1110. Thanks `@Roman-Koshelev <https://github.com/Roman-Koshelev>`_.
  1111. * Fixed handling of very large precision in fixed format
  1112. (`#2616 <https://github.com/fmtlib/fmt/pull/2616>`_).
  1113. * Made a table of cached powers used in FP formatting static
  1114. (`#2509 <https://github.com/fmtlib/fmt/pull/2509>`_).
  1115. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  1116. * Resolved a lookup ambiguity with C++20 format-related functions due to ADL
  1117. (`#2639 <https://github.com/fmtlib/fmt/issues/2639>`_,
  1118. `#2641 <https://github.com/fmtlib/fmt/pull/2641>`_).
  1119. Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_.
  1120. * Removed unnecessary inline namespace qualification
  1121. (`#2642 <https://github.com/fmtlib/fmt/issues/2642>`_,
  1122. `#2643 <https://github.com/fmtlib/fmt/pull/2643>`_).
  1123. Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_.
  1124. * Implemented argument forwarding in ``format_to_n``
  1125. (`#2462 <https://github.com/fmtlib/fmt/issues/2462>`_,
  1126. `#2463 <https://github.com/fmtlib/fmt/pull/2463>`_).
  1127. Thanks `@owent (WenTao Ou) <https://github.com/owent>`_.
  1128. * Fixed handling of implicit conversions in ``fmt::to_string`` and format string
  1129. compilation (`#2565 <https://github.com/fmtlib/fmt/issues/2565>`_).
  1130. * Changed the default access mode of files created by ``fmt::output_file`` to
  1131. ``-rw-r--r--`` for consistency with ``fopen``
  1132. (`#2530 <https://github.com/fmtlib/fmt/issues/2530>`_).
  1133. * Make ``fmt::ostream::flush`` public
  1134. (`#2435 <https://github.com/fmtlib/fmt/issues/2435>`_).
  1135. * Improved C++14/17 attribute detection
  1136. (`#2615 <https://github.com/fmtlib/fmt/pull/2615>`_).
  1137. Thanks `@AlexGuteniev (Alex Guteniev) <https://github.com/AlexGuteniev>`_.
  1138. * Improved ``consteval`` detection for MSVC
  1139. (`#2559 <https://github.com/fmtlib/fmt/pull/2559>`_).
  1140. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  1141. * Improved documentation
  1142. (`#2406 <https://github.com/fmtlib/fmt/issues/2406>`_,
  1143. `#2446 <https://github.com/fmtlib/fmt/pull/2446>`_,
  1144. `#2493 <https://github.com/fmtlib/fmt/issues/2493>`_,
  1145. `#2513 <https://github.com/fmtlib/fmt/issues/2513>`_,
  1146. `#2515 <https://github.com/fmtlib/fmt/pull/2515>`_,
  1147. `#2522 <https://github.com/fmtlib/fmt/issues/2522>`_,
  1148. `#2562 <https://github.com/fmtlib/fmt/pull/2562>`_,
  1149. `#2575 <https://github.com/fmtlib/fmt/pull/2575>`_,
  1150. `#2606 <https://github.com/fmtlib/fmt/pull/2606>`_,
  1151. `#2620 <https://github.com/fmtlib/fmt/pull/2620>`_,
  1152. `#2676 <https://github.com/fmtlib/fmt/issues/2676>`_).
  1153. Thanks `@sobolevn (Nikita Sobolev) <https://github.com/sobolevn>`_,
  1154. `@UnePierre (Max FERGER) <https://github.com/UnePierre>`_,
  1155. `@zhsj <https://github.com/zhsj>`_,
  1156. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  1157. `@ericcurtin (Eric Curtin) <https://github.com/ericcurtin>`_,
  1158. `@Lounarok <https://github.com/Lounarok>`_.
  1159. * Improved fuzzers and added a fuzzer for chrono timepoint formatting
  1160. (`#2461 <https://github.com/fmtlib/fmt/pull/2461>`_,
  1161. `#2469 <https://github.com/fmtlib/fmt/pull/2469>`_).
  1162. `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_,
  1163. * Added the ``FMT_SYSTEM_HEADERS`` CMake option setting which marks {fmt}'s
  1164. headers as system. It can be used to suppress warnings
  1165. (`#2644 <https://github.com/fmtlib/fmt/issues/2644>`_,
  1166. `#2651 <https://github.com/fmtlib/fmt/pull/2651>`_).
  1167. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1168. * Added the Bazel build system support
  1169. (`#2505 <https://github.com/fmtlib/fmt/pull/2505>`_,
  1170. `#2516 <https://github.com/fmtlib/fmt/pull/2516>`_).
  1171. Thanks `@Vertexwahn <https://github.com/Vertexwahn>`_.
  1172. * Improved build configuration and tests
  1173. (`#2437 <https://github.com/fmtlib/fmt/issues/2437>`_,
  1174. `#2558 <https://github.com/fmtlib/fmt/pull/2558>`_,
  1175. `#2648 <https://github.com/fmtlib/fmt/pull/2648>`_,
  1176. `#2650 <https://github.com/fmtlib/fmt/pull/2650>`_,
  1177. `#2663 <https://github.com/fmtlib/fmt/pull/2663>`_,
  1178. `#2677 <https://github.com/fmtlib/fmt/pull/2677>`_).
  1179. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  1180. `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_,
  1181. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1182. * Fixed various warnings and compilation issues
  1183. (`#2353 <https://github.com/fmtlib/fmt/pull/2353>`_,
  1184. `#2356 <https://github.com/fmtlib/fmt/pull/2356>`_,
  1185. `#2399 <https://github.com/fmtlib/fmt/pull/2399>`_,
  1186. `#2408 <https://github.com/fmtlib/fmt/issues/2408>`_,
  1187. `#2414 <https://github.com/fmtlib/fmt/pull/2414>`_,
  1188. `#2427 <https://github.com/fmtlib/fmt/pull/2427>`_,
  1189. `#2432 <https://github.com/fmtlib/fmt/pull/2432>`_,
  1190. `#2442 <https://github.com/fmtlib/fmt/pull/2442>`_,
  1191. `#2434 <https://github.com/fmtlib/fmt/pull/2434>`_,
  1192. `#2439 <https://github.com/fmtlib/fmt/issues/2439>`_,
  1193. `#2447 <https://github.com/fmtlib/fmt/pull/2447>`_,
  1194. `#2450 <https://github.com/fmtlib/fmt/pull/2450>`_,
  1195. `#2455 <https://github.com/fmtlib/fmt/issues/2455>`_,
  1196. `#2465 <https://github.com/fmtlib/fmt/issues/2465>`_,
  1197. `#2472 <https://github.com/fmtlib/fmt/issues/2472>`_,
  1198. `#2474 <https://github.com/fmtlib/fmt/issues/2474>`_,
  1199. `#2476 <https://github.com/fmtlib/fmt/pull/2476>`_,
  1200. `#2478 <https://github.com/fmtlib/fmt/issues/2478>`_,
  1201. `#2479 <https://github.com/fmtlib/fmt/issues/2479>`_,
  1202. `#2481 <https://github.com/fmtlib/fmt/issues/2481>`_,
  1203. `#2482 <https://github.com/fmtlib/fmt/pull/2482>`_,
  1204. `#2483 <https://github.com/fmtlib/fmt/pull/2483>`_,
  1205. `#2490 <https://github.com/fmtlib/fmt/issues/2490>`_,
  1206. `#2491 <https://github.com/fmtlib/fmt/pull/2491>`_,
  1207. `#2510 <https://github.com/fmtlib/fmt/pull/2510>`_,
  1208. `#2518 <https://github.com/fmtlib/fmt/pull/2518>`_,
  1209. `#2528 <https://github.com/fmtlib/fmt/issues/2528>`_,
  1210. `#2529 <https://github.com/fmtlib/fmt/pull/2529>`_,
  1211. `#2539 <https://github.com/fmtlib/fmt/pull/2539>`_,
  1212. `#2540 <https://github.com/fmtlib/fmt/issues/2540>`_,
  1213. `#2545 <https://github.com/fmtlib/fmt/pull/2545>`_,
  1214. `#2555 <https://github.com/fmtlib/fmt/pull/2555>`_,
  1215. `#2557 <https://github.com/fmtlib/fmt/issues/2557>`_,
  1216. `#2570 <https://github.com/fmtlib/fmt/issues/2570>`_,
  1217. `#2573 <https://github.com/fmtlib/fmt/pull/2573>`_,
  1218. `#2582 <https://github.com/fmtlib/fmt/pull/2582>`_,
  1219. `#2605 <https://github.com/fmtlib/fmt/issues/2605>`_,
  1220. `#2611 <https://github.com/fmtlib/fmt/pull/2611>`_,
  1221. `#2647 <https://github.com/fmtlib/fmt/pull/2647>`_,
  1222. `#2627 <https://github.com/fmtlib/fmt/issues/2627>`_,
  1223. `#2630 <https://github.com/fmtlib/fmt/pull/2630>`_,
  1224. `#2635 <https://github.com/fmtlib/fmt/issues/2635>`_,
  1225. `#2638 <https://github.com/fmtlib/fmt/issues/2638>`_,
  1226. `#2653 <https://github.com/fmtlib/fmt/issues/2653>`_,
  1227. `#2654 <https://github.com/fmtlib/fmt/issues/2654>`_,
  1228. `#2661 <https://github.com/fmtlib/fmt/issues/2661>`_,
  1229. `#2664 <https://github.com/fmtlib/fmt/pull/2664>`_,
  1230. `#2684 <https://github.com/fmtlib/fmt/pull/2684>`_).
  1231. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  1232. `@mwinterb <https://github.com/mwinterb>`_,
  1233. `@cdacamar (Cameron DaCamara) <https://github.com/cdacamar>`_,
  1234. `@TrebledJ (Johnathan) <https://github.com/TrebledJ>`_,
  1235. `@bodomartin (brm) <https://github.com/bodomartin>`_,
  1236. `@cquammen (Cory Quammen) <https://github.com/cquammen>`_,
  1237. `@white238 (Chris White) <https://github.com/white238>`_,
  1238. `@mmarkeloff (Max) <https://github.com/mmarkeloff>`_,
  1239. `@palacaze (Pierre-Antoine Lacaze) <https://github.com/palacaze>`_,
  1240. `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_,
  1241. `@mborn-adi (Mathias Born) <https://github.com/mborn-adi>`_,
  1242. `@BrukerJWD (Jonathan W) <https://github.com/BrukerJWD>`_,
  1243. `@spyridon97 (Spiros Tsalikis) <https://github.com/spyridon97>`_,
  1244. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  1245. `@oliverlee (Oliver Lee) <https://github.com/oliverlee>`_,
  1246. `@joshessman-llnl (Josh Essman) <https://github.com/joshessman-llnl>`_,
  1247. `@akohlmey (Axel Kohlmeyer) <https://github.com/akohlmey>`_,
  1248. `@timkalu <https://github.com/timkalu>`_,
  1249. `@olupton (Olli Lupton) <https://github.com/olupton>`_,
  1250. `@Acretock <https://github.com/Acretock>`_,
  1251. `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_,
  1252. `@andrewcorrigan (Andrew Corrigan) <https://github.com/andrewcorrigan>`_,
  1253. `@lucpelletier <https://github.com/lucpelletier>`_,
  1254. `@HazardyKnusperkeks (Björn Schäpers)
  1255. <https://github.com/HazardyKnusperkeks>`_.
  1256. 8.0.1 - 2021-07-02
  1257. ------------------
  1258. * Fixed the version number in the inline namespace
  1259. (`#2374 <https://github.com/fmtlib/fmt/issues/2374>`_).
  1260. * Added a missing presentation type check for ``std::string``
  1261. (`#2402 <https://github.com/fmtlib/fmt/issues/2402>`_).
  1262. * Fixed a linkage error when mixing code built with clang and gcc
  1263. (`#2377 <https://github.com/fmtlib/fmt/issues/2377>`_).
  1264. * Fixed documentation issues
  1265. (`#2396 <https://github.com/fmtlib/fmt/pull/2396>`_,
  1266. `#2403 <https://github.com/fmtlib/fmt/issues/2403>`_,
  1267. `#2406 <https://github.com/fmtlib/fmt/issues/2406>`_).
  1268. Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_.
  1269. * Removed dead code in FP formatter (
  1270. `#2398 <https://github.com/fmtlib/fmt/pull/2398>`_).
  1271. Thanks `@javierhonduco (Javier Honduvilla Coto)
  1272. <https://github.com/javierhonduco>`_.
  1273. * Fixed various warnings and compilation issues
  1274. (`#2351 <https://github.com/fmtlib/fmt/issues/2351>`_,
  1275. `#2359 <https://github.com/fmtlib/fmt/issues/2359>`_,
  1276. `#2365 <https://github.com/fmtlib/fmt/pull/2365>`_,
  1277. `#2368 <https://github.com/fmtlib/fmt/issues/2368>`_,
  1278. `#2370 <https://github.com/fmtlib/fmt/pull/2370>`_,
  1279. `#2376 <https://github.com/fmtlib/fmt/pull/2376>`_,
  1280. `#2381 <https://github.com/fmtlib/fmt/pull/2381>`_,
  1281. `#2382 <https://github.com/fmtlib/fmt/pull/2382>`_,
  1282. `#2386 <https://github.com/fmtlib/fmt/issues/2386>`_,
  1283. `#2389 <https://github.com/fmtlib/fmt/pull/2389>`_,
  1284. `#2395 <https://github.com/fmtlib/fmt/pull/2395>`_,
  1285. `#2397 <https://github.com/fmtlib/fmt/pull/2397>`_,
  1286. `#2400 <https://github.com/fmtlib/fmt/issues/2400>`_,
  1287. `#2401 <https://github.com/fmtlib/fmt/issues/2401>`_,
  1288. `#2407 <https://github.com/fmtlib/fmt/pull/2407>`_).
  1289. Thanks `@zx2c4 (Jason A. Donenfeld) <https://github.com/zx2c4>`_,
  1290. `@AidanSun05 (Aidan Sun) <https://github.com/AidanSun05>`_,
  1291. `@mattiasljungstrom (Mattias Ljungström)
  1292. <https://github.com/mattiasljungstrom>`_,
  1293. `@joemmett (Jonathan Emmett) <https://github.com/joemmett>`_,
  1294. `@erengy (Eren Okka) <https://github.com/erengy>`_,
  1295. `@patlkli (Patrick Geltinger) <https://github.com/patlkli>`_,
  1296. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  1297. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1298. 8.0.0 - 2021-06-21
  1299. ------------------
  1300. * Enabled compile-time format string checks by default.
  1301. For example (`godbolt <https://godbolt.org/z/sMxcohGjz>`__):
  1302. .. code:: c++
  1303. #include <fmt/core.h>
  1304. int main() {
  1305. fmt::print("{:d}", "I am not a number");
  1306. }
  1307. gives a compile-time error on compilers with C++20 ``consteval`` support
  1308. (gcc 10+, clang 11+) because ``d`` is not a valid format specifier for a
  1309. string.
  1310. To pass a runtime string wrap it in ``fmt::runtime``:
  1311. .. code:: c++
  1312. fmt::print(fmt::runtime("{:d}"), "I am not a number");
  1313. * Added compile-time formatting
  1314. (`#2019 <https://github.com/fmtlib/fmt/pull/2019>`_,
  1315. `#2044 <https://github.com/fmtlib/fmt/pull/2044>`_,
  1316. `#2056 <https://github.com/fmtlib/fmt/pull/2056>`_,
  1317. `#2072 <https://github.com/fmtlib/fmt/pull/2072>`_,
  1318. `#2075 <https://github.com/fmtlib/fmt/pull/2075>`_,
  1319. `#2078 <https://github.com/fmtlib/fmt/issues/2078>`_,
  1320. `#2129 <https://github.com/fmtlib/fmt/pull/2129>`_,
  1321. `#2326 <https://github.com/fmtlib/fmt/pull/2326>`_).
  1322. For example (`godbolt <https://godbolt.org/z/Mxx9d89jM>`__):
  1323. .. code:: c++
  1324. #include <fmt/compile.h>
  1325. consteval auto compile_time_itoa(int value) -> std::array<char, 10> {
  1326. auto result = std::array<char, 10>();
  1327. fmt::format_to(result.data(), FMT_COMPILE("{}"), value);
  1328. return result;
  1329. }
  1330. constexpr auto answer = compile_time_itoa(42);
  1331. Most of the formatting functionality is available at compile time with a
  1332. notable exception of floating-point numbers and pointers.
  1333. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1334. * Optimized handling of format specifiers during format string compilation.
  1335. For example, hexadecimal formatting (``"{:x}"``) is now 3-7x faster than
  1336. before when using ``format_to`` with format string compilation and a
  1337. stack-allocated buffer (`#1944 <https://github.com/fmtlib/fmt/issues/1944>`_).
  1338. Before (7.1.3)::
  1339. ----------------------------------------------------------------------------
  1340. Benchmark Time CPU Iterations
  1341. ----------------------------------------------------------------------------
  1342. FMTCompileOld/0 15.5 ns 15.5 ns 43302898
  1343. FMTCompileOld/42 16.6 ns 16.6 ns 43278267
  1344. FMTCompileOld/273123 18.7 ns 18.6 ns 37035861
  1345. FMTCompileOld/9223372036854775807 19.4 ns 19.4 ns 35243000
  1346. ----------------------------------------------------------------------------
  1347. After (8.x)::
  1348. ----------------------------------------------------------------------------
  1349. Benchmark Time CPU Iterations
  1350. ----------------------------------------------------------------------------
  1351. FMTCompileNew/0 1.99 ns 1.99 ns 360523686
  1352. FMTCompileNew/42 2.33 ns 2.33 ns 279865664
  1353. FMTCompileNew/273123 3.72 ns 3.71 ns 190230315
  1354. FMTCompileNew/9223372036854775807 5.28 ns 5.26 ns 130711631
  1355. ----------------------------------------------------------------------------
  1356. It is even faster than ``std::to_chars`` from libc++ compiled with clang on
  1357. macOS::
  1358. ----------------------------------------------------------------------------
  1359. Benchmark Time CPU Iterations
  1360. ----------------------------------------------------------------------------
  1361. ToChars/0 4.42 ns 4.41 ns 160196630
  1362. ToChars/42 5.00 ns 4.98 ns 140735201
  1363. ToChars/273123 7.26 ns 7.24 ns 95784130
  1364. ToChars/9223372036854775807 8.77 ns 8.75 ns 75872534
  1365. ----------------------------------------------------------------------------
  1366. In other cases, especially involving ``std::string`` construction, the
  1367. speed up is usually lower because handling format specifiers takes a smaller
  1368. fraction of the total time.
  1369. * Added the ``_cf`` user-defined literal to represent a compiled format string.
  1370. It can be used instead of the ``FMT_COMPILE`` macro
  1371. (`#2043 <https://github.com/fmtlib/fmt/pull/2043>`_,
  1372. `#2242 <https://github.com/fmtlib/fmt/pull/2242>`_):
  1373. .. code:: c++
  1374. #include <fmt/compile.h>
  1375. using namespace fmt::literals;
  1376. auto s = fmt::format(FMT_COMPILE("{}"), 42); // 🙁 not modern
  1377. auto s = fmt::format("{}"_cf, 42); // 🙂 modern as hell
  1378. It requires compiler support for class types in non-type template parameters
  1379. (a C++20 feature) which is available in GCC 9.3+.
  1380. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1381. * Format string compilation now requires ``format`` functions of ``formatter``
  1382. specializations for user-defined types to be ``const``:
  1383. .. code:: c++
  1384. template <> struct fmt::formatter<my_type>: formatter<string_view> {
  1385. template <typename FormatContext>
  1386. auto format(my_type obj, FormatContext& ctx) const { // Note const here.
  1387. // ...
  1388. }
  1389. };
  1390. * Added UDL-based named argument support to format string compilation
  1391. (`#2243 <https://github.com/fmtlib/fmt/pull/2243>`_,
  1392. `#2281 <https://github.com/fmtlib/fmt/pull/2281>`_). For example:
  1393. .. code:: c++
  1394. #include <fmt/compile.h>
  1395. using namespace fmt::literals;
  1396. auto s = fmt::format(FMT_COMPILE("{answer}"), "answer"_a = 42);
  1397. Here the argument named "answer" is resolved at compile time with no
  1398. runtime overhead.
  1399. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1400. * Added format string compilation support to ``fmt::print``
  1401. (`#2280 <https://github.com/fmtlib/fmt/issues/2280>`_,
  1402. `#2304 <https://github.com/fmtlib/fmt/pull/2304>`_).
  1403. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1404. * Added initial support for compiling {fmt} as a C++20 module
  1405. (`#2235 <https://github.com/fmtlib/fmt/pull/2235>`_,
  1406. `#2240 <https://github.com/fmtlib/fmt/pull/2240>`_,
  1407. `#2260 <https://github.com/fmtlib/fmt/pull/2260>`_,
  1408. `#2282 <https://github.com/fmtlib/fmt/pull/2282>`_,
  1409. `#2283 <https://github.com/fmtlib/fmt/pull/2283>`_,
  1410. `#2288 <https://github.com/fmtlib/fmt/pull/2288>`_,
  1411. `#2298 <https://github.com/fmtlib/fmt/pull/2298>`_,
  1412. `#2306 <https://github.com/fmtlib/fmt/pull/2306>`_,
  1413. `#2307 <https://github.com/fmtlib/fmt/pull/2307>`_,
  1414. `#2309 <https://github.com/fmtlib/fmt/pull/2309>`_,
  1415. `#2318 <https://github.com/fmtlib/fmt/pull/2318>`_,
  1416. `#2324 <https://github.com/fmtlib/fmt/pull/2324>`_,
  1417. `#2332 <https://github.com/fmtlib/fmt/pull/2332>`_,
  1418. `#2340 <https://github.com/fmtlib/fmt/pull/2340>`_).
  1419. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  1420. * Made symbols private by default reducing shared library size
  1421. (`#2301 <https://github.com/fmtlib/fmt/pull/2301>`_). For example there was
  1422. a ~15% reported reduction on one platform.
  1423. Thanks `@sergiud (Sergiu Deitsch) <https://github.com/sergiud>`_.
  1424. * Optimized includes making the result of preprocessing ``fmt/format.h``
  1425. ~20% smaller with libstdc++/C++20 and slightly improving build times
  1426. (`#1998 <https://github.com/fmtlib/fmt/issues/1998>`_).
  1427. * Added support of ranges with non-const ``begin`` / ``end``
  1428. (`#1953 <https://github.com/fmtlib/fmt/pull/1953>`_).
  1429. Thanks `@kitegi (sarah) <https://github.com/kitegi>`_.
  1430. * Added support of ``std::byte`` and other formattable types to ``fmt::join``
  1431. (`#1981 <https://github.com/fmtlib/fmt/issues/1981>`_,
  1432. `#2040 <https://github.com/fmtlib/fmt/issues/2040>`_,
  1433. `#2050 <https://github.com/fmtlib/fmt/pull/2050>`_,
  1434. `#2262 <https://github.com/fmtlib/fmt/issues/2262>`_). For example:
  1435. .. code:: c++
  1436. #include <fmt/format.h>
  1437. #include <cstddef>
  1438. #include <vector>
  1439. int main() {
  1440. auto bytes = std::vector{std::byte(4), std::byte(2)};
  1441. fmt::print("{}", fmt::join(bytes, ""));
  1442. }
  1443. prints "42".
  1444. Thanks `@kamibo (Camille Bordignon) <https://github.com/kamibo>`_.
  1445. * Implemented the default format for ``std::chrono::system_clock``
  1446. (`#2319 <https://github.com/fmtlib/fmt/issues/2319>`_,
  1447. `#2345 <https://github.com/fmtlib/fmt/pull/2345>`_). For example:
  1448. .. code:: c++
  1449. #include <fmt/chrono.h>
  1450. int main() {
  1451. fmt::print("{}", std::chrono::system_clock::now());
  1452. }
  1453. prints "2021-06-18 15:22:00" (the output depends on the current date and
  1454. time). Thanks `@sunmy2019 <https://github.com/sunmy2019>`_.
  1455. * Made more chrono specifiers locale independent by default. Use the ``'L'``
  1456. specifier to get localized formatting. For example:
  1457. .. code:: c++
  1458. #include <fmt/chrono.h>
  1459. int main() {
  1460. std::locale::global(std::locale("ru_RU.UTF-8"));
  1461. auto monday = std::chrono::weekday(1);
  1462. fmt::print("{}\n", monday); // prints "Mon"
  1463. fmt::print("{:L}\n", monday); // prints "пн"
  1464. }
  1465. * Improved locale handling in chrono formatting
  1466. (`#2337 <https://github.com/fmtlib/fmt/issues/2337>`_,
  1467. `#2349 <https://github.com/fmtlib/fmt/pull/2349>`_,
  1468. `#2350 <https://github.com/fmtlib/fmt/pull/2350>`_).
  1469. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1470. * Deprecated ``fmt/locale.h`` moving the formatting functions that take a
  1471. locale to ``fmt/format.h`` (``char``) and ``fmt/xchar`` (other overloads).
  1472. This doesn't introduce a dependency on ``<locale>`` so there is virtually no
  1473. compile time effect.
  1474. * Deprecated an undocumented ``format_to`` overload that takes
  1475. ``basic_memory_buffer``.
  1476. * Made parameter order in ``vformat_to`` consistent with ``format_to``
  1477. (`#2327 <https://github.com/fmtlib/fmt/issues/2327>`_).
  1478. * Added support for time points with arbitrary durations
  1479. (`#2208 <https://github.com/fmtlib/fmt/issues/2208>`_). For example:
  1480. .. code:: c++
  1481. #include <fmt/chrono.h>
  1482. int main() {
  1483. using tp = std::chrono::time_point<
  1484. std::chrono::system_clock, std::chrono::seconds>;
  1485. fmt::print("{:%S}", tp(std::chrono::seconds(42)));
  1486. }
  1487. prints "42".
  1488. * Formatting floating-point numbers no longer produces trailing zeros by default
  1489. for consistency with ``std::format``. For example:
  1490. .. code:: c++
  1491. #include <fmt/core.h>
  1492. int main() {
  1493. fmt::print("{0:.3}", 1.1);
  1494. }
  1495. prints "1.1". Use the ``'#'`` specifier to keep trailing zeros.
  1496. * Dropped a limit on the number of elements in a range and replaced ``{}`` with
  1497. ``[]`` as range delimiters for consistency with Python's ``str.format``.
  1498. * The ``'L'`` specifier for locale-specific numeric formatting can now be
  1499. combined with presentation specifiers as in ``std::format``. For example:
  1500. .. code:: c++
  1501. #include <fmt/core.h>
  1502. #include <locale>
  1503. int main() {
  1504. std::locale::global(std::locale("fr_FR.UTF-8"));
  1505. fmt::print("{0:.2Lf}", 0.42);
  1506. }
  1507. prints "0,42". The deprecated ``'n'`` specifier has been removed.
  1508. * Made the ``0`` specifier ignored for infinity and NaN
  1509. (`#2305 <https://github.com/fmtlib/fmt/issues/2305>`_,
  1510. `#2310 <https://github.com/fmtlib/fmt/pull/2310>`_).
  1511. Thanks `@Liedtke (Matthias Liedtke) <https://github.com/Liedtke>`_.
  1512. * Made the hexfloat formatting use the right alignment by default
  1513. (`#2308 <https://github.com/fmtlib/fmt/issues/2308>`_,
  1514. `#2317 <https://github.com/fmtlib/fmt/pull/2317>`_).
  1515. Thanks `@Liedtke (Matthias Liedtke) <https://github.com/Liedtke>`_.
  1516. * Removed the deprecated numeric alignment (``'='``). Use the ``'0'`` specifier
  1517. instead.
  1518. * Removed the deprecated ``fmt/posix.h`` header that has been replaced with
  1519. ``fmt/os.h``.
  1520. * Removed the deprecated ``format_to_n_context``, ``format_to_n_args`` and
  1521. ``make_format_to_n_args``. They have been replaced with ``format_context``,
  1522. ``format_args` and ``make_format_args`` respectively.
  1523. * Moved ``wchar_t``-specific functions and types to ``fmt/xchar.h``.
  1524. You can define ``FMT_DEPRECATED_INCLUDE_XCHAR`` to automatically include
  1525. ``fmt/xchar.h`` from ``fmt/format.h`` but this will be disabled in the next
  1526. major release.
  1527. * Fixed handling of the ``'+'`` specifier in localized formatting
  1528. (`#2133 <https://github.com/fmtlib/fmt/issues/2133>`_).
  1529. * Added support for the ``'s'`` format specifier that gives textual
  1530. representation of ``bool``
  1531. (`#2094 <https://github.com/fmtlib/fmt/issues/2094>`_,
  1532. `#2109 <https://github.com/fmtlib/fmt/pull/2109>`_). For example:
  1533. .. code:: c++
  1534. #include <fmt/core.h>
  1535. int main() {
  1536. fmt::print("{:s}", true);
  1537. }
  1538. prints "true".
  1539. Thanks `@powercoderlol (Ivan Polyakov) <https://github.com/powercoderlol>`_.
  1540. * Made ``fmt::ptr`` work with function pointers
  1541. (`#2131 <https://github.com/fmtlib/fmt/pull/2131>`_). For example:
  1542. .. code:: c++
  1543. #include <fmt/format.h>
  1544. int main() {
  1545. fmt::print("My main: {}\n", fmt::ptr(main));
  1546. }
  1547. Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_.
  1548. * The undocumented support for specializing ``formatter`` for pointer types
  1549. has been removed.
  1550. * Fixed ``fmt::formatted_size`` with format string compilation
  1551. (`#2141 <https://github.com/fmtlib/fmt/pull/2141>`_,
  1552. `#2161 <https://github.com/fmtlib/fmt/pull/2161>`_).
  1553. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1554. * Fixed handling of empty format strings during format string compilation
  1555. (`#2042 <https://github.com/fmtlib/fmt/issues/2042>`_):
  1556. .. code:: c++
  1557. auto s = fmt::format(FMT_COMPILE(""));
  1558. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1559. * Fixed handling of enums in ``fmt::to_string``
  1560. (`#2036 <https://github.com/fmtlib/fmt/issues/2036>`_).
  1561. * Improved width computation
  1562. (`#2033 <https://github.com/fmtlib/fmt/issues/2033>`_,
  1563. `#2091 <https://github.com/fmtlib/fmt/issues/2091>`_). For example:
  1564. .. code:: c++
  1565. #include <fmt/core.h>
  1566. int main() {
  1567. fmt::print("{:-<10}{}\n", "你好", "世界");
  1568. fmt::print("{:-<10}{}\n", "hello", "world");
  1569. }
  1570. prints
  1571. .. image:: https://user-images.githubusercontent.com/576385/
  1572. 119840373-cea3ca80-beb9-11eb-91e0-54266c48e181.png
  1573. on a modern terminal.
  1574. * The experimental fast output stream (``fmt::ostream``) is now truncated by
  1575. default for consistency with ``fopen``
  1576. (`#2018 <https://github.com/fmtlib/fmt/issues/2018>`_). For example:
  1577. .. code:: c++
  1578. #include <fmt/os.h>
  1579. int main() {
  1580. fmt::ostream out1 = fmt::output_file("guide");
  1581. out1.print("Zaphod");
  1582. out1.close();
  1583. fmt::ostream out2 = fmt::output_file("guide");
  1584. out2.print("Ford");
  1585. }
  1586. writes "Ford" to the file "guide". To preserve the old file content if any
  1587. pass ``fmt::file::WRONLY | fmt::file::CREATE`` flags to ``fmt::output_file``.
  1588. * Fixed moving of ``fmt::ostream`` that holds buffered data
  1589. (`#2197 <https://github.com/fmtlib/fmt/issues/2197>`_,
  1590. `#2198 <https://github.com/fmtlib/fmt/pull/2198>`_).
  1591. Thanks `@vtta <https://github.com/vtta>`_.
  1592. * Replaced the ``fmt::system_error`` exception with a function of the same
  1593. name that constructs ``std::system_error``
  1594. (`#2266 <https://github.com/fmtlib/fmt/issues/2266>`_).
  1595. * Replaced the ``fmt::windows_error`` exception with a function of the same
  1596. name that constructs ``std::system_error`` with the category returned by
  1597. ``fmt::system_category()``
  1598. (`#2274 <https://github.com/fmtlib/fmt/issues/2274>`_,
  1599. `#2275 <https://github.com/fmtlib/fmt/pull/2275>`_).
  1600. The latter is similar to ``std::sytem_category`` but correctly handles UTF-8.
  1601. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1602. * Replaced ``fmt::error_code`` with ``std::error_code`` and made it formattable
  1603. (`#2269 <https://github.com/fmtlib/fmt/issues/2269>`_,
  1604. `#2270 <https://github.com/fmtlib/fmt/pull/2270>`_,
  1605. `#2273 <https://github.com/fmtlib/fmt/pull/2273>`_).
  1606. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1607. * Added speech synthesis support
  1608. (`#2206 <https://github.com/fmtlib/fmt/pull/2206>`_).
  1609. * Made ``format_to`` work with a memory buffer that has a custom allocator
  1610. (`#2300 <https://github.com/fmtlib/fmt/pull/2300>`_).
  1611. Thanks `@voxmea <https://github.com/voxmea>`_.
  1612. * Added ``Allocator::max_size`` support to ``basic_memory_buffer``.
  1613. (`#1960 <https://github.com/fmtlib/fmt/pull/1960>`_).
  1614. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1615. * Added wide string support to ``fmt::join``
  1616. (`#2236 <https://github.com/fmtlib/fmt/pull/2236>`_).
  1617. Thanks `@crbrz <https://github.com/crbrz>`_.
  1618. * Made iterators passed to ``formatter`` specializations via a format context
  1619. satisfy C++20 ``std::output_iterator`` requirements
  1620. (`#2156 <https://github.com/fmtlib/fmt/issues/2156>`_,
  1621. `#2158 <https://github.com/fmtlib/fmt/pull/2158>`_,
  1622. `#2195 <https://github.com/fmtlib/fmt/issues/2195>`_,
  1623. `#2204 <https://github.com/fmtlib/fmt/pull/2204>`_).
  1624. Thanks `@randomnetcat (Jason Cobb) <https://github.com/randomnetcat>`_.
  1625. * Optimized the ``printf`` implementation
  1626. (`#1982 <https://github.com/fmtlib/fmt/pull/1982>`_,
  1627. `#1984 <https://github.com/fmtlib/fmt/pull/1984>`_,
  1628. `#2016 <https://github.com/fmtlib/fmt/pull/2016>`_,
  1629. `#2164 <https://github.com/fmtlib/fmt/pull/2164>`_).
  1630. Thanks `@rimathia <https://github.com/rimathia>`_ and
  1631. `@moiwi <https://github.com/moiwi>`_.
  1632. * Improved detection of ``constexpr`` ``char_traits``
  1633. (`#2246 <https://github.com/fmtlib/fmt/pull/2246>`_,
  1634. `#2257 <https://github.com/fmtlib/fmt/pull/2257>`_).
  1635. Thanks `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_.
  1636. * Fixed writing to ``stdout`` when it is redirected to ``NUL`` on Windows
  1637. (`#2080 <https://github.com/fmtlib/fmt/issues/2080>`_).
  1638. * Fixed exception propagation from iterators
  1639. (`#2097 <https://github.com/fmtlib/fmt/issues/2097>`_).
  1640. * Improved ``strftime`` error handling
  1641. (`#2238 <https://github.com/fmtlib/fmt/issues/2238>`_,
  1642. `#2244 <https://github.com/fmtlib/fmt/pull/2244>`_).
  1643. Thanks `@yumeyao <https://github.com/yumeyao>`_.
  1644. * Stopped using deprecated GCC UDL template extension.
  1645. * Added ``fmt/args.h`` to the install target
  1646. (`#2096 <https://github.com/fmtlib/fmt/issues/2096>`_).
  1647. * Error messages are now passed to assert when exceptions are disabled
  1648. (`#2145 <https://github.com/fmtlib/fmt/pull/2145>`_).
  1649. Thanks `@NobodyXu (Jiahao XU) <https://github.com/NobodyXu>`_.
  1650. * Added the ``FMT_MASTER_PROJECT`` CMake option to control build and install
  1651. targets when {fmt} is included via ``add_subdirectory``
  1652. (`#2098 <https://github.com/fmtlib/fmt/issues/2098>`_,
  1653. `#2100 <https://github.com/fmtlib/fmt/pull/2100>`_).
  1654. Thanks `@randomizedthinking <https://github.com/randomizedthinking>`_.
  1655. * Improved build configuration
  1656. (`#2026 <https://github.com/fmtlib/fmt/pull/2026>`_,
  1657. `#2122 <https://github.com/fmtlib/fmt/pull/2122>`_).
  1658. Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and
  1659. `@ibaned (Dan Ibanez) <https://github.com/ibaned>`_.
  1660. * Fixed various warnings and compilation issues
  1661. (`#1947 <https://github.com/fmtlib/fmt/issues/1947>`_,
  1662. `#1959 <https://github.com/fmtlib/fmt/pull/1959>`_,
  1663. `#1963 <https://github.com/fmtlib/fmt/pull/1963>`_,
  1664. `#1965 <https://github.com/fmtlib/fmt/pull/1965>`_,
  1665. `#1966 <https://github.com/fmtlib/fmt/issues/1966>`_,
  1666. `#1974 <https://github.com/fmtlib/fmt/pull/1974>`_,
  1667. `#1975 <https://github.com/fmtlib/fmt/pull/1975>`_,
  1668. `#1990 <https://github.com/fmtlib/fmt/pull/1990>`_,
  1669. `#2000 <https://github.com/fmtlib/fmt/issues/2000>`_,
  1670. `#2001 <https://github.com/fmtlib/fmt/pull/2001>`_,
  1671. `#2002 <https://github.com/fmtlib/fmt/issues/2002>`_,
  1672. `#2004 <https://github.com/fmtlib/fmt/issues/2004>`_,
  1673. `#2006 <https://github.com/fmtlib/fmt/pull/2006>`_,
  1674. `#2009 <https://github.com/fmtlib/fmt/pull/2009>`_,
  1675. `#2010 <https://github.com/fmtlib/fmt/pull/2010>`_,
  1676. `#2038 <https://github.com/fmtlib/fmt/issues/2038>`_,
  1677. `#2039 <https://github.com/fmtlib/fmt/issues/2039>`_,
  1678. `#2047 <https://github.com/fmtlib/fmt/issues/2047>`_,
  1679. `#2053 <https://github.com/fmtlib/fmt/pull/2053>`_,
  1680. `#2059 <https://github.com/fmtlib/fmt/issues/2059>`_,
  1681. `#2065 <https://github.com/fmtlib/fmt/pull/2065>`_,
  1682. `#2067 <https://github.com/fmtlib/fmt/pull/2067>`_,
  1683. `#2068 <https://github.com/fmtlib/fmt/pull/2068>`_,
  1684. `#2073 <https://github.com/fmtlib/fmt/pull/2073>`_,
  1685. `#2103 <https://github.com/fmtlib/fmt/issues/2103>`_,
  1686. `#2105 <https://github.com/fmtlib/fmt/issues/2105>`_,
  1687. `#2106 <https://github.com/fmtlib/fmt/pull/2106>`_,
  1688. `#2107 <https://github.com/fmtlib/fmt/pull/2107>`_,
  1689. `#2116 <https://github.com/fmtlib/fmt/issues/2116>`_,
  1690. `#2117 <https://github.com/fmtlib/fmt/pull/2117>`_,
  1691. `#2118 <https://github.com/fmtlib/fmt/issues/2118>`_,
  1692. `#2119 <https://github.com/fmtlib/fmt/pull/2119>`_,
  1693. `#2127 <https://github.com/fmtlib/fmt/issues/2127>`_,
  1694. `#2128 <https://github.com/fmtlib/fmt/pull/2128>`_,
  1695. `#2140 <https://github.com/fmtlib/fmt/issues/2140>`_,
  1696. `#2142 <https://github.com/fmtlib/fmt/issues/2142>`_,
  1697. `#2143 <https://github.com/fmtlib/fmt/pull/2143>`_,
  1698. `#2144 <https://github.com/fmtlib/fmt/pull/2144>`_,
  1699. `#2147 <https://github.com/fmtlib/fmt/issues/2147>`_,
  1700. `#2148 <https://github.com/fmtlib/fmt/issues/2148>`_,
  1701. `#2149 <https://github.com/fmtlib/fmt/issues/2149>`_,
  1702. `#2152 <https://github.com/fmtlib/fmt/pull/2152>`_,
  1703. `#2160 <https://github.com/fmtlib/fmt/pull/2160>`_,
  1704. `#2170 <https://github.com/fmtlib/fmt/issues/2170>`_,
  1705. `#2175 <https://github.com/fmtlib/fmt/issues/2175>`_,
  1706. `#2176 <https://github.com/fmtlib/fmt/issues/2176>`_,
  1707. `#2177 <https://github.com/fmtlib/fmt/pull/2177>`_,
  1708. `#2178 <https://github.com/fmtlib/fmt/issues/2178>`_,
  1709. `#2179 <https://github.com/fmtlib/fmt/pull/2179>`_,
  1710. `#2180 <https://github.com/fmtlib/fmt/issues/2180>`_,
  1711. `#2181 <https://github.com/fmtlib/fmt/issues/2181>`_,
  1712. `#2183 <https://github.com/fmtlib/fmt/pull/2183>`_,
  1713. `#2184 <https://github.com/fmtlib/fmt/issues/2184>`_,
  1714. `#2185 <https://github.com/fmtlib/fmt/issues/2185>`_,
  1715. `#2186 <https://github.com/fmtlib/fmt/pull/2186>`_,
  1716. `#2187 <https://github.com/fmtlib/fmt/pull/2187>`_,
  1717. `#2190 <https://github.com/fmtlib/fmt/pull/2190>`_,
  1718. `#2192 <https://github.com/fmtlib/fmt/pull/2192>`_,
  1719. `#2194 <https://github.com/fmtlib/fmt/pull/2194>`_,
  1720. `#2205 <https://github.com/fmtlib/fmt/pull/2205>`_,
  1721. `#2210 <https://github.com/fmtlib/fmt/issues/2210>`_,
  1722. `#2211 <https://github.com/fmtlib/fmt/pull/2211>`_,
  1723. `#2215 <https://github.com/fmtlib/fmt/pull/2215>`_,
  1724. `#2216 <https://github.com/fmtlib/fmt/pull/2216>`_,
  1725. `#2218 <https://github.com/fmtlib/fmt/pull/2218>`_,
  1726. `#2220 <https://github.com/fmtlib/fmt/pull/2220>`_,
  1727. `#2228 <https://github.com/fmtlib/fmt/issues/2228>`_,
  1728. `#2229 <https://github.com/fmtlib/fmt/pull/2229>`_,
  1729. `#2230 <https://github.com/fmtlib/fmt/pull/2230>`_,
  1730. `#2233 <https://github.com/fmtlib/fmt/issues/2233>`_,
  1731. `#2239 <https://github.com/fmtlib/fmt/pull/2239>`_,
  1732. `#2248 <https://github.com/fmtlib/fmt/issues/2248>`_,
  1733. `#2252 <https://github.com/fmtlib/fmt/issues/2252>`_,
  1734. `#2253 <https://github.com/fmtlib/fmt/pull/2253>`_,
  1735. `#2255 <https://github.com/fmtlib/fmt/pull/2255>`_,
  1736. `#2261 <https://github.com/fmtlib/fmt/issues/2261>`_,
  1737. `#2278 <https://github.com/fmtlib/fmt/issues/2278>`_,
  1738. `#2284 <https://github.com/fmtlib/fmt/issues/2284>`_,
  1739. `#2287 <https://github.com/fmtlib/fmt/pull/2287>`_,
  1740. `#2289 <https://github.com/fmtlib/fmt/pull/2289>`_,
  1741. `#2290 <https://github.com/fmtlib/fmt/pull/2290>`_,
  1742. `#2293 <https://github.com/fmtlib/fmt/pull/2293>`_,
  1743. `#2295 <https://github.com/fmtlib/fmt/issues/2295>`_,
  1744. `#2296 <https://github.com/fmtlib/fmt/pull/2296>`_,
  1745. `#2297 <https://github.com/fmtlib/fmt/pull/2297>`_,
  1746. `#2311 <https://github.com/fmtlib/fmt/issues/2311>`_,
  1747. `#2313 <https://github.com/fmtlib/fmt/pull/2313>`_,
  1748. `#2315 <https://github.com/fmtlib/fmt/pull/2315>`_,
  1749. `#2320 <https://github.com/fmtlib/fmt/issues/2320>`_,
  1750. `#2321 <https://github.com/fmtlib/fmt/pull/2321>`_,
  1751. `#2323 <https://github.com/fmtlib/fmt/pull/2323>`_,
  1752. `#2328 <https://github.com/fmtlib/fmt/issues/2328>`_,
  1753. `#2329 <https://github.com/fmtlib/fmt/pull/2329>`_,
  1754. `#2333 <https://github.com/fmtlib/fmt/pull/2333>`_,
  1755. `#2338 <https://github.com/fmtlib/fmt/pull/2338>`_,
  1756. `#2341 <https://github.com/fmtlib/fmt/pull/2341>`_).
  1757. Thanks `@darklukee <https://github.com/darklukee>`_,
  1758. `@fagg (Ashton Fagg) <https://github.com/fagg>`_,
  1759. `@killerbot242 (Lieven de Cock) <https://github.com/killerbot242>`_,
  1760. `@jgopel (Jonathan Gopel) <https://github.com/jgopel>`_,
  1761. `@yeswalrus (Walter Gray) <https://github.com/yeswalrus>`_,
  1762. `@Finkman <https://github.com/Finkman>`_,
  1763. `@HazardyKnusperkeks (Björn Schäpers) <https://github.com/HazardyKnusperkeks>`_,
  1764. `@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_,
  1765. `@concatime (Issam Maghni) <https://github.com/concatime>`_,
  1766. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  1767. `@summivox (Yin Zhong) <https://github.com/summivox>`_,
  1768. `@yNeo <https://github.com/yNeo>`_,
  1769. `@Apache-HB (Elliot) <https://github.com/Apache-HB>`_,
  1770. `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_,
  1771. `@toojays (John Steele Scott) <https://github.com/toojays>`_,
  1772. `@Brainy0207 <https://github.com/Brainy0207>`_,
  1773. `@vadz (VZ) <https://github.com/vadz>`_,
  1774. `@imsherlock (Ryan Sherlock) <https://github.com/imsherlock>`_,
  1775. `@phprus (Vladislav Shchapov) <https://github.com/phprus>`_,
  1776. `@white238 (Chris White) <https://github.com/white238>`_,
  1777. `@yafshar (Yaser Afshar) <https://github.com/yafshar>`_,
  1778. `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_,
  1779. `@jstaahl <https://github.com/jstaahl>`_,
  1780. `@denchat <https://github.com/denchat>`_,
  1781. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  1782. `@ilyakurdyukov (Ilya Kurdyukov) <https://github.com/ilyakurdyukov>`_,
  1783. `@ilmai <https://github.com/ilmai>`_,
  1784. `@JessyDL (Jessy De Lannoit) <https://github.com/JessyDL>`_,
  1785. `@sergiud (Sergiu Deitsch) <https://github.com/sergiud>`_,
  1786. `@mwinterb <https://github.com/mwinterb>`_,
  1787. `@sven-herrmann <https://github.com/sven-herrmann>`_,
  1788. `@jmelas (John Melas) <https://github.com/jmelas>`_,
  1789. `@twoixter (Jose Miguel Pérez) <https://github.com/twoixter>`_,
  1790. `@crbrz <https://github.com/crbrz>`_,
  1791. `@upsj (Tobias Ribizel) <https://github.com/upsj>`_.
  1792. * Improved documentation
  1793. (`#1986 <https://github.com/fmtlib/fmt/issues/1986>`_,
  1794. `#2051 <https://github.com/fmtlib/fmt/pull/2051>`_,
  1795. `#2057 <https://github.com/fmtlib/fmt/issues/2057>`_,
  1796. `#2081 <https://github.com/fmtlib/fmt/pull/2081>`_,
  1797. `#2084 <https://github.com/fmtlib/fmt/issues/2084>`_,
  1798. `#2312 <https://github.com/fmtlib/fmt/pull/2312>`_).
  1799. Thanks `@imba-tjd (谭九鼎) <https://github.com/imba-tjd>`_,
  1800. `@0x416c69 (AlιAѕѕaѕѕιN) <https://github.com/0x416c69>`_,
  1801. `@mordante <https://github.com/mordante>`_.
  1802. * Continuous integration and test improvements
  1803. (`#1969 <https://github.com/fmtlib/fmt/issues/1969>`_,
  1804. `#1991 <https://github.com/fmtlib/fmt/pull/1991>`_,
  1805. `#2020 <https://github.com/fmtlib/fmt/pull/2020>`_,
  1806. `#2110 <https://github.com/fmtlib/fmt/pull/2110>`_,
  1807. `#2114 <https://github.com/fmtlib/fmt/pull/2114>`_,
  1808. `#2196 <https://github.com/fmtlib/fmt/issues/2196>`_,
  1809. `#2217 <https://github.com/fmtlib/fmt/pull/2217>`_,
  1810. `#2247 <https://github.com/fmtlib/fmt/pull/2247>`_,
  1811. `#2256 <https://github.com/fmtlib/fmt/pull/2256>`_,
  1812. `#2336 <https://github.com/fmtlib/fmt/pull/2336>`_,
  1813. `#2346 <https://github.com/fmtlib/fmt/pull/2346>`_).
  1814. Thanks `@jgopel (Jonathan Gopel) <https://github.com/jgopel>`_,
  1815. `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_ and
  1816. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  1817. 7.1.3 - 2020-11-24
  1818. ------------------
  1819. * Fixed handling of buffer boundaries in ``format_to_n``
  1820. (`#1996 <https://github.com/fmtlib/fmt/issues/1996>`_,
  1821. `#2029 <https://github.com/fmtlib/fmt/issues/2029>`_).
  1822. * Fixed linkage errors when linking with a shared library
  1823. (`#2011 <https://github.com/fmtlib/fmt/issues/2011>`_).
  1824. * Reintroduced ostream support to range formatters
  1825. (`#2014 <https://github.com/fmtlib/fmt/issues/2014>`_).
  1826. * Worked around an issue with mixing std versions in gcc
  1827. (`#2017 <https://github.com/fmtlib/fmt/issues/2017>`_).
  1828. 7.1.2 - 2020-11-04
  1829. ------------------
  1830. * Fixed floating point formatting with large precision
  1831. (`#1976 <https://github.com/fmtlib/fmt/issues/1976>`_).
  1832. 7.1.1 - 2020-11-01
  1833. ------------------
  1834. * Fixed ABI compatibility with 7.0.x
  1835. (`#1961 <https://github.com/fmtlib/fmt/issues/1961>`_).
  1836. * Added the ``FMT_ARM_ABI_COMPATIBILITY`` macro to work around ABI
  1837. incompatibility between GCC and Clang on ARM
  1838. (`#1919 <https://github.com/fmtlib/fmt/issues/1919>`_).
  1839. * Worked around a SFINAE bug in GCC 8
  1840. (`#1957 <https://github.com/fmtlib/fmt/issues/1957>`_).
  1841. * Fixed linkage errors when building with GCC's LTO
  1842. (`#1955 <https://github.com/fmtlib/fmt/issues/1955>`_).
  1843. * Fixed a compilation error when building without ``__builtin_clz`` or equivalent
  1844. (`#1968 <https://github.com/fmtlib/fmt/pull/1968>`_).
  1845. Thanks `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_.
  1846. * Fixed a sign conversion warning
  1847. (`#1964 <https://github.com/fmtlib/fmt/pull/1964>`_).
  1848. Thanks `@OptoCloud <https://github.com/OptoCloud>`_.
  1849. 7.1.0 - 2020-10-25
  1850. ------------------
  1851. * Switched from `Grisu3
  1852. <https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf>`_
  1853. to `Dragonbox <https://github.com/jk-jeon/dragonbox>`_ for the default
  1854. floating-point formatting which gives the shortest decimal representation
  1855. with round-trip guarantee and correct rounding
  1856. (`#1882 <https://github.com/fmtlib/fmt/pull/1882>`_,
  1857. `#1887 <https://github.com/fmtlib/fmt/pull/1887>`_,
  1858. `#1894 <https://github.com/fmtlib/fmt/pull/1894>`_). This makes {fmt} up to
  1859. 20-30x faster than common implementations of ``std::ostringstream`` and
  1860. ``sprintf`` on `dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_
  1861. and faster than double-conversion and Ryū:
  1862. .. image:: https://user-images.githubusercontent.com/576385/
  1863. 95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png
  1864. It is possible to get even better performance at the cost of larger binary
  1865. size by compiling with the ``FMT_USE_FULL_CACHE_DRAGONBOX`` macro set to 1.
  1866. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  1867. * Added an experimental unsynchronized file output API which, together with
  1868. `format string compilation <https://fmt.dev/latest/api.html#compile-api>`_,
  1869. can give `5-9 times speed up compared to fprintf
  1870. <https://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html>`_
  1871. on common platforms (`godbolt <https://godbolt.org/z/nsTcG8>`__):
  1872. .. code:: c++
  1873. #include <fmt/os.h>
  1874. int main() {
  1875. auto f = fmt::output_file("guide");
  1876. f.print("The answer is {}.", 42);
  1877. }
  1878. * Added a formatter for ``std::chrono::time_point<system_clock>``
  1879. (`#1819 <https://github.com/fmtlib/fmt/issues/1819>`_,
  1880. `#1837 <https://github.com/fmtlib/fmt/pull/1837>`_). For example
  1881. (`godbolt <https://godbolt.org/z/c4M6fh>`__):
  1882. .. code:: c++
  1883. #include <fmt/chrono.h>
  1884. int main() {
  1885. auto now = std::chrono::system_clock::now();
  1886. fmt::print("The time is {:%H:%M:%S}.\n", now);
  1887. }
  1888. Thanks `@adamburgess (Adam Burgess) <https://github.com/adamburgess>`_.
  1889. * Added support for ranges with non-const ``begin``/``end`` to ``fmt::join``
  1890. (`#1784 <https://github.com/fmtlib/fmt/issues/1784>`_,
  1891. `#1786 <https://github.com/fmtlib/fmt/pull/1786>`_). For example
  1892. (`godbolt <https://godbolt.org/z/jP63Tv>`__):
  1893. .. code:: c++
  1894. #include <fmt/ranges.h>
  1895. #include <range/v3/view/filter.hpp>
  1896. int main() {
  1897. using std::literals::string_literals::operator""s;
  1898. auto strs = std::array{"a"s, "bb"s, "ccc"s};
  1899. auto range = strs | ranges::views::filter(
  1900. [] (const std::string &x) { return x.size() != 2; }
  1901. );
  1902. fmt::print("{}\n", fmt::join(range, ""));
  1903. }
  1904. prints "accc".
  1905. Thanks `@tonyelewis (Tony E Lewis) <https://github.com/tonyelewis>`_.
  1906. * Added a ``memory_buffer::append`` overload that takes a range
  1907. (`#1806 <https://github.com/fmtlib/fmt/pull/1806>`_).
  1908. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  1909. * Improved handling of single code units in ``FMT_COMPILE``. For example:
  1910. .. code:: c++
  1911. #include <fmt/compile.h>
  1912. char* f(char* buf) {
  1913. return fmt::format_to(buf, FMT_COMPILE("x{}"), 42);
  1914. }
  1915. compiles to just (`godbolt <https://godbolt.org/z/5vncz3>`__):
  1916. .. code:: asm
  1917. _Z1fPc:
  1918. movb $120, (%rdi)
  1919. xorl %edx, %edx
  1920. cmpl $42, _ZN3fmt2v76detail10basic_dataIvE23zero_or_powers_of_10_32E+8(%rip)
  1921. movl $3, %eax
  1922. seta %dl
  1923. subl %edx, %eax
  1924. movzwl _ZN3fmt2v76detail10basic_dataIvE6digitsE+84(%rip), %edx
  1925. cltq
  1926. addq %rdi, %rax
  1927. movw %dx, -2(%rax)
  1928. ret
  1929. Here a single ``mov`` instruction writes ``'x'`` (``$120``) to the output
  1930. buffer.
  1931. * Added dynamic width support to format string compilation
  1932. (`#1809 <https://github.com/fmtlib/fmt/issues/1809>`_).
  1933. * Improved error reporting for unformattable types: now you'll get the type name
  1934. directly in the error message instead of the note:
  1935. .. code:: c++
  1936. #include <fmt/core.h>
  1937. struct how_about_no {};
  1938. int main() {
  1939. fmt::print("{}", how_about_no());
  1940. }
  1941. Error (`godbolt <https://godbolt.org/z/GoxM4e>`__):
  1942. ``fmt/core.h:1438:3: error: static_assert failed due to requirement
  1943. 'fmt::v7::formattable<how_about_no>()' "Cannot format an argument.
  1944. To make type T formattable provide a formatter<T> specialization:
  1945. https://fmt.dev/latest/api.html#udt"
  1946. ...``
  1947. * Added the `make_args_checked <https://fmt.dev/7.1.0/api.html#argument-lists>`_
  1948. function template that allows you to write formatting functions with
  1949. compile-time format string checks and avoid binary code bloat
  1950. (`godbolt <https://godbolt.org/z/PEf9qr>`__):
  1951. .. code:: c++
  1952. void vlog(const char* file, int line, fmt::string_view format,
  1953. fmt::format_args args) {
  1954. fmt::print("{}: {}: ", file, line);
  1955. fmt::vprint(format, args);
  1956. }
  1957. template <typename S, typename... Args>
  1958. void log(const char* file, int line, const S& format, Args&&... args) {
  1959. vlog(file, line, format,
  1960. fmt::make_args_checked<Args...>(format, args...));
  1961. }
  1962. #define MY_LOG(format, ...) \
  1963. log(__FILE__, __LINE__, FMT_STRING(format), __VA_ARGS__)
  1964. MY_LOG("invalid squishiness: {}", 42);
  1965. * Replaced ``snprintf`` fallback with a faster internal IEEE 754 ``float`` and
  1966. ``double`` formatter for arbitrary precision. For example
  1967. (`godbolt <https://godbolt.org/z/dPhWvj>`__):
  1968. .. code:: c++
  1969. #include <fmt/core.h>
  1970. int main() {
  1971. fmt::print("{:.500}\n", 4.9406564584124654E-324);
  1972. }
  1973. prints
  1974. ``4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324``.
  1975. * Made ``format_to_n`` and ``formatted_size`` part of the `core API
  1976. <https://fmt.dev/latest/api.html#core-api>`__
  1977. (`godbolt <https://godbolt.org/z/sPjY1K>`__):
  1978. .. code:: c++
  1979. #include <fmt/core.h>
  1980. int main() {
  1981. char buffer[10];
  1982. auto result = fmt::format_to_n(buffer, sizeof(buffer), "{}", 42);
  1983. }
  1984. * Added ``fmt::format_to_n`` overload with format string compilation
  1985. (`#1764 <https://github.com/fmtlib/fmt/issues/1764>`_,
  1986. `#1767 <https://github.com/fmtlib/fmt/pull/1767>`_,
  1987. `#1869 <https://github.com/fmtlib/fmt/pull/1869>`_). For example
  1988. (`godbolt <https://godbolt.org/z/93h86q>`__):
  1989. .. code:: c++
  1990. #include <fmt/compile.h>
  1991. int main() {
  1992. char buffer[8];
  1993. fmt::format_to_n(buffer, sizeof(buffer), FMT_COMPILE("{}"), 42);
  1994. }
  1995. Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
  1996. `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  1997. * Added ``fmt::format_to`` overload that take ``text_style``
  1998. (`#1593 <https://github.com/fmtlib/fmt/issues/1593>`_,
  1999. `#1842 <https://github.com/fmtlib/fmt/issues/1842>`_,
  2000. `#1843 <https://github.com/fmtlib/fmt/pull/1843>`_). For example
  2001. (`godbolt <https://godbolt.org/z/91153r>`__):
  2002. .. code:: c++
  2003. #include <fmt/color.h>
  2004. int main() {
  2005. std::string out;
  2006. fmt::format_to(std::back_inserter(out),
  2007. fmt::emphasis::bold | fg(fmt::color::red),
  2008. "The answer is {}.", 42);
  2009. }
  2010. Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
  2011. * Made the ``'#'`` specifier emit trailing zeros in addition to the decimal
  2012. point (`#1797 <https://github.com/fmtlib/fmt/issues/1797>`_). For example
  2013. (`godbolt <https://godbolt.org/z/bhdcW9>`__):
  2014. .. code:: c++
  2015. #include <fmt/core.h>
  2016. int main() {
  2017. fmt::print("{:#.2g}", 0.5);
  2018. }
  2019. prints ``0.50``.
  2020. * Changed the default floating point format to not include ``.0`` for
  2021. consistency with ``std::format`` and ``std::to_chars``
  2022. (`#1893 <https://github.com/fmtlib/fmt/issues/1893>`_,
  2023. `#1943 <https://github.com/fmtlib/fmt/issues/1943>`_). It is possible to get
  2024. the decimal point and trailing zero with the ``#`` specifier.
  2025. * Fixed an issue with floating-point formatting that could result in addition of
  2026. a non-significant trailing zero in rare cases e.g. ``1.00e-34`` instead of
  2027. ``1.0e-34`` (`#1873 <https://github.com/fmtlib/fmt/issues/1873>`_,
  2028. `#1917 <https://github.com/fmtlib/fmt/issues/1917>`_).
  2029. * Made ``fmt::to_string`` fallback on ``ostream`` insertion operator if
  2030. the ``formatter`` specialization is not provided
  2031. (`#1815 <https://github.com/fmtlib/fmt/issues/1815>`_,
  2032. `#1829 <https://github.com/fmtlib/fmt/pull/1829>`_).
  2033. Thanks `@alexezeder (Alexey Ochapov) <https://github.com/alexezeder>`_.
  2034. * Added support for the append mode to the experimental file API and
  2035. improved ``fcntl.h`` detection.
  2036. (`#1847 <https://github.com/fmtlib/fmt/pull/1847>`_,
  2037. `#1848 <https://github.com/fmtlib/fmt/pull/1848>`_).
  2038. Thanks `@t-wiser <https://github.com/t-wiser>`_.
  2039. * Fixed handling of types that have both an implicit conversion operator and
  2040. an overloaded ``ostream`` insertion operator
  2041. (`#1766 <https://github.com/fmtlib/fmt/issues/1766>`_).
  2042. * Fixed a slicing issue in an internal iterator type
  2043. (`#1822 <https://github.com/fmtlib/fmt/pull/1822>`_).
  2044. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  2045. * Fixed an issue in locale-specific integer formatting
  2046. (`#1927 <https://github.com/fmtlib/fmt/issues/1927>`_).
  2047. * Fixed handling of exotic code unit types
  2048. (`#1870 <https://github.com/fmtlib/fmt/issues/1870>`_,
  2049. `#1932 <https://github.com/fmtlib/fmt/issues/1932>`_).
  2050. * Improved ``FMT_ALWAYS_INLINE``
  2051. (`#1878 <https://github.com/fmtlib/fmt/pull/1878>`_).
  2052. Thanks `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_.
  2053. * Removed dependency on ``windows.h``
  2054. (`#1900 <https://github.com/fmtlib/fmt/pull/1900>`_).
  2055. Thanks `@bernd5 (Bernd Baumanns) <https://github.com/bernd5>`_.
  2056. * Optimized counting of decimal digits on MSVC
  2057. (`#1890 <https://github.com/fmtlib/fmt/pull/1890>`_).
  2058. Thanks `@mwinterb <https://github.com/mwinterb>`_.
  2059. * Improved documentation
  2060. (`#1772 <https://github.com/fmtlib/fmt/issues/1772>`_,
  2061. `#1775 <https://github.com/fmtlib/fmt/pull/1775>`_,
  2062. `#1792 <https://github.com/fmtlib/fmt/pull/1792>`_,
  2063. `#1838 <https://github.com/fmtlib/fmt/pull/1838>`_,
  2064. `#1888 <https://github.com/fmtlib/fmt/pull/1888>`_,
  2065. `#1918 <https://github.com/fmtlib/fmt/pull/1918>`_,
  2066. `#1939 <https://github.com/fmtlib/fmt/pull/1939>`_).
  2067. Thanks `@leolchat (Léonard Gérard) <https://github.com/leolchat>`_,
  2068. `@pepsiman (Malcolm Parsons) <https://github.com/pepsiman>`_,
  2069. `@Klaim (Joël Lamotte) <https://github.com/Klaim>`_,
  2070. `@ravijanjam (Ravi J) <https://github.com/ravijanjam>`_,
  2071. `@francesco-st <https://github.com/francesco-st>`_,
  2072. `@udnaan (Adnan) <https://github.com/udnaan>`_.
  2073. * Added the ``FMT_REDUCE_INT_INSTANTIATIONS`` CMake option that reduces the
  2074. binary code size at the cost of some integer formatting performance. This can
  2075. be useful for extremely memory-constrained embedded systems
  2076. (`#1778 <https://github.com/fmtlib/fmt/issues/1778>`_,
  2077. `#1781 <https://github.com/fmtlib/fmt/pull/1781>`_).
  2078. Thanks `@kammce (Khalil Estell) <https://github.com/kammce>`_.
  2079. * Added the ``FMT_USE_INLINE_NAMESPACES`` macro to control usage of inline
  2080. namespaces (`#1945 <https://github.com/fmtlib/fmt/pull/1945>`_).
  2081. Thanks `@darklukee <https://github.com/darklukee>`_.
  2082. * Improved build configuration
  2083. (`#1760 <https://github.com/fmtlib/fmt/pull/1760>`_,
  2084. `#1770 <https://github.com/fmtlib/fmt/pull/1770>`_,
  2085. `#1779 <https://github.com/fmtlib/fmt/issues/1779>`_,
  2086. `#1783 <https://github.com/fmtlib/fmt/pull/1783>`_,
  2087. `#1823 <https://github.com/fmtlib/fmt/pull/1823>`_).
  2088. Thanks `@dvetutnev (Dmitriy Vetutnev) <https://github.com/dvetutnev>`_,
  2089. `@xvitaly (Vitaly Zaitsev) <https://github.com/xvitaly>`_,
  2090. `@tambry (Raul Tambre) <https://github.com/tambry>`_,
  2091. `@medithe <https://github.com/medithe>`_,
  2092. `@martinwuehrer (Martin Wührer) <https://github.com/martinwuehrer>`_.
  2093. * Fixed various warnings and compilation issues
  2094. (`#1790 <https://github.com/fmtlib/fmt/pull/1790>`_,
  2095. `#1802 <https://github.com/fmtlib/fmt/pull/1802>`_,
  2096. `#1808 <https://github.com/fmtlib/fmt/pull/1808>`_,
  2097. `#1810 <https://github.com/fmtlib/fmt/issues/1810>`_,
  2098. `#1811 <https://github.com/fmtlib/fmt/issues/1811>`_,
  2099. `#1812 <https://github.com/fmtlib/fmt/pull/1812>`_,
  2100. `#1814 <https://github.com/fmtlib/fmt/pull/1814>`_,
  2101. `#1816 <https://github.com/fmtlib/fmt/pull/1816>`_,
  2102. `#1817 <https://github.com/fmtlib/fmt/pull/1817>`_,
  2103. `#1818 <https://github.com/fmtlib/fmt/pull/1818>`_,
  2104. `#1825 <https://github.com/fmtlib/fmt/issues/1825>`_,
  2105. `#1836 <https://github.com/fmtlib/fmt/pull/1836>`_,
  2106. `#1855 <https://github.com/fmtlib/fmt/pull/1855>`_,
  2107. `#1856 <https://github.com/fmtlib/fmt/pull/1856>`_,
  2108. `#1860 <https://github.com/fmtlib/fmt/pull/1860>`_,
  2109. `#1877 <https://github.com/fmtlib/fmt/pull/1877>`_,
  2110. `#1879 <https://github.com/fmtlib/fmt/pull/1879>`_,
  2111. `#1880 <https://github.com/fmtlib/fmt/pull/1880>`_,
  2112. `#1896 <https://github.com/fmtlib/fmt/issues/1896>`_,
  2113. `#1897 <https://github.com/fmtlib/fmt/pull/1897>`_,
  2114. `#1898 <https://github.com/fmtlib/fmt/pull/1898>`_,
  2115. `#1904 <https://github.com/fmtlib/fmt/issues/1904>`_,
  2116. `#1908 <https://github.com/fmtlib/fmt/pull/1908>`_,
  2117. `#1911 <https://github.com/fmtlib/fmt/issues/1911>`_,
  2118. `#1912 <https://github.com/fmtlib/fmt/issues/1912>`_,
  2119. `#1928 <https://github.com/fmtlib/fmt/issues/1928>`_,
  2120. `#1929 <https://github.com/fmtlib/fmt/pull/1929>`_,
  2121. `#1935 <https://github.com/fmtlib/fmt/issues/1935>`_,
  2122. `#1937 <https://github.com/fmtlib/fmt/pull/1937>`_,
  2123. `#1942 <https://github.com/fmtlib/fmt/pull/1942>`_,
  2124. `#1949 <https://github.com/fmtlib/fmt/issues/1949>`_).
  2125. Thanks `@TheQwertiest <https://github.com/TheQwertiest>`_,
  2126. `@medithe <https://github.com/medithe>`_,
  2127. `@martinwuehrer (Martin Wührer) <https://github.com/martinwuehrer>`_,
  2128. `@n16h7hunt3r <https://github.com/n16h7hunt3r>`_,
  2129. `@Othereum (Seokjin Lee) <https://github.com/Othereum>`_,
  2130. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  2131. `@AlexanderLanin (Alexander Lanin) <https://github.com/AlexanderLanin>`_,
  2132. `@gcerretani (Giovanni Cerretani) <https://github.com/gcerretani>`_,
  2133. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  2134. `@noizefloor (Jan Schwers) <https://github.com/noizefloor>`_,
  2135. `@akohlmey (Axel Kohlmeyer) <https://github.com/akohlmey>`_,
  2136. `@jk-jeon (Junekey Jeon) <https://github.com/jk-jeon>`_,
  2137. `@rimathia <https://github.com/rimathia>`_,
  2138. `@rglarix (Riccardo Ghetta (larix)) <https://github.com/rglarix>`_,
  2139. `@moiwi <https://github.com/moiwi>`_,
  2140. `@heckad (Kazantcev Andrey) <https://github.com/heckad>`_,
  2141. `@MarcDirven <https://github.com/MarcDirven>`_.
  2142. `@BartSiwek (Bart Siwek) <https://github.com/BartSiwek>`_,
  2143. `@darklukee <https://github.com/darklukee>`_.
  2144. 7.0.3 - 2020-08-06
  2145. ------------------
  2146. * Worked around broken ``numeric_limits`` for 128-bit integers
  2147. (`#1787 <https://github.com/fmtlib/fmt/issues/1787>`_).
  2148. * Added error reporting on missing named arguments
  2149. (`#1796 <https://github.com/fmtlib/fmt/issues/1796>`_).
  2150. * Stopped using 128-bit integers with clang-cl
  2151. (`#1800 <https://github.com/fmtlib/fmt/pull/1800>`_).
  2152. Thanks `@Kingcom <https://github.com/Kingcom>`_.
  2153. * Fixed issues in locale-specific integer formatting
  2154. (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_,
  2155. `#1801 <https://github.com/fmtlib/fmt/issues/1801>`_).
  2156. 7.0.2 - 2020-07-29
  2157. ------------------
  2158. * Worked around broken ``numeric_limits`` for 128-bit integers
  2159. (`#1725 <https://github.com/fmtlib/fmt/issues/1725>`_).
  2160. * Fixed compatibility with CMake 3.4
  2161. (`#1779 <https://github.com/fmtlib/fmt/issues/1779>`_).
  2162. * Fixed handling of digit separators in locale-specific formatting
  2163. (`#1782 <https://github.com/fmtlib/fmt/issues/1782>`_).
  2164. 7.0.1 - 2020-07-07
  2165. ------------------
  2166. * Updated the inline version namespace name.
  2167. * Worked around a gcc bug in mangling of alias templates
  2168. (`#1753 <https://github.com/fmtlib/fmt/issues/1753>`_).
  2169. * Fixed a linkage error on Windows
  2170. (`#1757 <https://github.com/fmtlib/fmt/issues/1757>`_).
  2171. Thanks `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_.
  2172. * Fixed minor issues with the documentation.
  2173. 7.0.0 - 2020-07-05
  2174. ------------------
  2175. * Reduced the library size. For example, on macOS a stripped test binary
  2176. statically linked with {fmt} `shrank from ~368k to less than 100k
  2177. <http://www.zverovich.net/2020/05/21/reducing-library-size.html>`_.
  2178. * Added a simpler and more efficient `format string compilation API
  2179. <https://fmt.dev/7.0.0/api.html#compile-api>`_:
  2180. .. code:: c++
  2181. #include <fmt/compile.h>
  2182. // Converts 42 into std::string using the most efficient method and no
  2183. // runtime format string processing.
  2184. std::string s = fmt::format(FMT_COMPILE("{}"), 42);
  2185. The old ``fmt::compile`` API is now deprecated.
  2186. * Optimized integer formatting: ``format_to`` with format string compilation
  2187. and a stack-allocated buffer is now `faster than to_chars on both
  2188. libc++ and libstdc++
  2189. <http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html>`_.
  2190. * Optimized handling of small format strings. For example,
  2191. .. code:: c++
  2192. fmt::format("Result: {}: ({},{},{},{})", str1, str2, str3, str4, str5)
  2193. is now ~40% faster (`#1685 <https://github.com/fmtlib/fmt/issues/1685>`_).
  2194. * Applied extern templates to improve compile times when using the core API
  2195. and ``fmt/format.h`` (`#1452 <https://github.com/fmtlib/fmt/issues/1452>`_).
  2196. For example, on macOS with clang the compile time of a test translation unit
  2197. dropped from 2.3s to 0.3s with ``-O2`` and from 0.6s to 0.3s with the default
  2198. settings (``-O0``).
  2199. Before (``-O2``)::
  2200. % time c++ -c test.cc -I include -std=c++17 -O2
  2201. c++ -c test.cc -I include -std=c++17 -O2 2.22s user 0.08s system 99% cpu 2.311 total
  2202. After (``-O2``)::
  2203. % time c++ -c test.cc -I include -std=c++17 -O2
  2204. c++ -c test.cc -I include -std=c++17 -O2 0.26s user 0.04s system 98% cpu 0.303 total
  2205. Before (default)::
  2206. % time c++ -c test.cc -I include -std=c++17
  2207. c++ -c test.cc -I include -std=c++17 0.53s user 0.06s system 98% cpu 0.601 total
  2208. After (default)::
  2209. % time c++ -c test.cc -I include -std=c++17
  2210. c++ -c test.cc -I include -std=c++17 0.24s user 0.06s system 98% cpu 0.301 total
  2211. It is still recommended to use ``fmt/core.h`` instead of ``fmt/format.h`` but
  2212. the compile time difference is now smaller. Thanks
  2213. `@alex3d <https://github.com/alex3d>`_ for the suggestion.
  2214. * Named arguments are now stored on stack (no dynamic memory allocations) and
  2215. the compiled code is more compact and efficient. For example
  2216. .. code:: c++
  2217. #include <fmt/core.h>
  2218. int main() {
  2219. fmt::print("The answer is {answer}\n", fmt::arg("answer", 42));
  2220. }
  2221. compiles to just (`godbolt <https://godbolt.org/z/NcfEp_>`__)
  2222. .. code:: asm
  2223. .LC0:
  2224. .string "answer"
  2225. .LC1:
  2226. .string "The answer is {answer}\n"
  2227. main:
  2228. sub rsp, 56
  2229. mov edi, OFFSET FLAT:.LC1
  2230. mov esi, 23
  2231. movabs rdx, 4611686018427387905
  2232. lea rax, [rsp+32]
  2233. lea rcx, [rsp+16]
  2234. mov QWORD PTR [rsp+8], 1
  2235. mov QWORD PTR [rsp], rax
  2236. mov DWORD PTR [rsp+16], 42
  2237. mov QWORD PTR [rsp+32], OFFSET FLAT:.LC0
  2238. mov DWORD PTR [rsp+40], 0
  2239. call fmt::v6::vprint(fmt::v6::basic_string_view<char>,
  2240. fmt::v6::format_args)
  2241. xor eax, eax
  2242. add rsp, 56
  2243. ret
  2244. .L.str.1:
  2245. .asciz "answer"
  2246. * Implemented compile-time checks for dynamic width and precision
  2247. (`#1614 <https://github.com/fmtlib/fmt/issues/1614>`_):
  2248. .. code:: c++
  2249. #include <fmt/format.h>
  2250. int main() {
  2251. fmt::print(FMT_STRING("{0:{1}}"), 42);
  2252. }
  2253. now gives a compilation error because argument 1 doesn't exist::
  2254. In file included from test.cc:1:
  2255. include/fmt/format.h:2726:27: error: constexpr variable 'invalid_format' must be
  2256. initialized by a constant expression
  2257. FMT_CONSTEXPR_DECL bool invalid_format =
  2258. ^
  2259. ...
  2260. include/fmt/core.h:569:26: note: in call to
  2261. '&checker(s, {}).context_->on_error(&"argument not found"[0])'
  2262. if (id >= num_args_) on_error("argument not found");
  2263. ^
  2264. * Added sentinel support to ``fmt::join``
  2265. (`#1689 <https://github.com/fmtlib/fmt/pull/1689>`_)
  2266. .. code:: c++
  2267. struct zstring_sentinel {};
  2268. bool operator==(const char* p, zstring_sentinel) { return *p == '\0'; }
  2269. bool operator!=(const char* p, zstring_sentinel) { return *p != '\0'; }
  2270. struct zstring {
  2271. const char* p;
  2272. const char* begin() const { return p; }
  2273. zstring_sentinel end() const { return {}; }
  2274. };
  2275. auto s = fmt::format("{}", fmt::join(zstring{"hello"}, "_"));
  2276. // s == "h_e_l_l_o"
  2277. Thanks `@BRevzin (Barry Revzin) <https://github.com/BRevzin>`_.
  2278. * Added support for named arguments, ``clear`` and ``reserve`` to
  2279. ``dynamic_format_arg_store``
  2280. (`#1655 <https://github.com/fmtlib/fmt/issues/1655>`_,
  2281. `#1663 <https://github.com/fmtlib/fmt/pull/1663>`_,
  2282. `#1674 <https://github.com/fmtlib/fmt/pull/1674>`_,
  2283. `#1677 <https://github.com/fmtlib/fmt/pull/1677>`_).
  2284. Thanks `@vsolontsov-ll (Vladimir Solontsov)
  2285. <https://github.com/vsolontsov-ll>`_.
  2286. * Added support for the ``'c'`` format specifier to integral types for
  2287. compatibility with ``std::format``
  2288. (`#1652 <https://github.com/fmtlib/fmt/issues/1652>`_).
  2289. * Replaced the ``'n'`` format specifier with ``'L'`` for compatibility with
  2290. ``std::format`` (`#1624 <https://github.com/fmtlib/fmt/issues/1624>`_).
  2291. The ``'n'`` specifier can be enabled via the ``FMT_DEPRECATED_N_SPECIFIER``
  2292. macro.
  2293. * The ``'='`` format specifier is now disabled by default for compatibility with
  2294. ``std::format``. It can be enabled via the ``FMT_DEPRECATED_NUMERIC_ALIGN``
  2295. macro.
  2296. * Removed the following deprecated APIs:
  2297. * ``FMT_STRING_ALIAS`` and ``fmt`` macros - replaced by ``FMT_STRING``
  2298. * ``fmt::basic_string_view::char_type`` - replaced by
  2299. ``fmt::basic_string_view::value_type``
  2300. * ``convert_to_int``
  2301. * ``format_arg_store::types``
  2302. * ``*parse_context`` - replaced by ``*format_parse_context``
  2303. * ``FMT_DEPRECATED_INCLUDE_OS``
  2304. * ``FMT_DEPRECATED_PERCENT`` - incompatible with ``std::format``
  2305. * ``*writer`` - replaced by compiled format API
  2306. * Renamed the ``internal`` namespace to ``detail``
  2307. (`#1538 <https://github.com/fmtlib/fmt/issues/1538>`_). The former is still
  2308. provided as an alias if the ``FMT_USE_INTERNAL`` macro is defined.
  2309. * Improved compatibility between ``fmt::printf`` with the standard specs
  2310. (`#1595 <https://github.com/fmtlib/fmt/issues/1595>`_,
  2311. `#1682 <https://github.com/fmtlib/fmt/pull/1682>`_,
  2312. `#1683 <https://github.com/fmtlib/fmt/pull/1683>`_,
  2313. `#1687 <https://github.com/fmtlib/fmt/pull/1687>`_,
  2314. `#1699 <https://github.com/fmtlib/fmt/pull/1699>`_).
  2315. Thanks `@rimathia <https://github.com/rimathia>`_.
  2316. * Fixed handling of ``operator<<`` overloads that use ``copyfmt``
  2317. (`#1666 <https://github.com/fmtlib/fmt/issues/1666>`_).
  2318. * Added the ``FMT_OS`` CMake option to control inclusion of OS-specific APIs
  2319. in the fmt target. This can be useful for embedded platforms
  2320. (`#1654 <https://github.com/fmtlib/fmt/issues/1654>`_,
  2321. `#1656 <https://github.com/fmtlib/fmt/pull/1656>`_).
  2322. Thanks `@kwesolowski (Krzysztof Wesolowski)
  2323. <https://github.com/kwesolowski>`_.
  2324. * Replaced ``FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`` with the ``FMT_FUZZ``
  2325. macro to prevent interfering with fuzzing of projects using {fmt}
  2326. (`#1650 <https://github.com/fmtlib/fmt/pull/1650>`_).
  2327. Thanks `@asraa (Asra Ali) <https://github.com/asraa>`_.
  2328. * Fixed compatibility with emscripten
  2329. (`#1636 <https://github.com/fmtlib/fmt/issues/1636>`_,
  2330. `#1637 <https://github.com/fmtlib/fmt/pull/1637>`_).
  2331. Thanks `@ArthurSonzogni (Arthur Sonzogni)
  2332. <https://github.com/ArthurSonzogni>`_.
  2333. * Improved documentation
  2334. (`#704 <https://github.com/fmtlib/fmt/issues/704>`_,
  2335. `#1643 <https://github.com/fmtlib/fmt/pull/1643>`_,
  2336. `#1660 <https://github.com/fmtlib/fmt/pull/1660>`_,
  2337. `#1681 <https://github.com/fmtlib/fmt/pull/1681>`_,
  2338. `#1691 <https://github.com/fmtlib/fmt/pull/1691>`_,
  2339. `#1706 <https://github.com/fmtlib/fmt/pull/1706>`_,
  2340. `#1714 <https://github.com/fmtlib/fmt/pull/1714>`_,
  2341. `#1721 <https://github.com/fmtlib/fmt/pull/1721>`_,
  2342. `#1739 <https://github.com/fmtlib/fmt/pull/1739>`_,
  2343. `#1740 <https://github.com/fmtlib/fmt/pull/1740>`_,
  2344. `#1741 <https://github.com/fmtlib/fmt/pull/1741>`_,
  2345. `#1751 <https://github.com/fmtlib/fmt/pull/1751>`_).
  2346. Thanks `@senior7515 (Alexander Gallego) <https://github.com/senior7515>`_,
  2347. `@lsr0 (Lindsay Roberts) <https://github.com/lsr0>`_,
  2348. `@puetzk (Kevin Puetz) <https://github.com/puetzk>`_,
  2349. `@fpelliccioni (Fernando Pelliccioni) <https://github.com/fpelliccioni>`_,
  2350. Alexey Kuzmenko, `@jelly (jelle van der Waa) <https://github.com/jelly>`_,
  2351. `@claremacrae (Clare Macrae) <https://github.com/claremacrae>`_,
  2352. `@jiapengwen (文佳鹏) <https://github.com/jiapengwen>`_,
  2353. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  2354. `@alexey-milovidov <https://github.com/alexey-milovidov>`_.
  2355. * Implemented various build configuration fixes and improvements
  2356. (`#1603 <https://github.com/fmtlib/fmt/pull/1603>`_,
  2357. `#1657 <https://github.com/fmtlib/fmt/pull/1657>`_,
  2358. `#1702 <https://github.com/fmtlib/fmt/pull/1702>`_,
  2359. `#1728 <https://github.com/fmtlib/fmt/pull/1728>`_).
  2360. Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_,
  2361. `@jtojnar (Jan Tojnar) <https://github.com/jtojnar>`_,
  2362. `@orivej (Orivej Desh) <https://github.com/orivej>`_,
  2363. `@flagarde <https://github.com/flagarde>`_.
  2364. * Fixed various warnings and compilation issues
  2365. (`#1616 <https://github.com/fmtlib/fmt/pull/1616>`_,
  2366. `#1620 <https://github.com/fmtlib/fmt/issues/1620>`_,
  2367. `#1622 <https://github.com/fmtlib/fmt/issues/1622>`_,
  2368. `#1625 <https://github.com/fmtlib/fmt/issues/1625>`_,
  2369. `#1627 <https://github.com/fmtlib/fmt/pull/1627>`_,
  2370. `#1628 <https://github.com/fmtlib/fmt/issues/1628>`_,
  2371. `#1629 <https://github.com/fmtlib/fmt/pull/1629>`_,
  2372. `#1631 <https://github.com/fmtlib/fmt/issues/1631>`_,
  2373. `#1633 <https://github.com/fmtlib/fmt/pull/1633>`_,
  2374. `#1649 <https://github.com/fmtlib/fmt/pull/1649>`_,
  2375. `#1658 <https://github.com/fmtlib/fmt/issues/1658>`_,
  2376. `#1661 <https://github.com/fmtlib/fmt/pull/1661>`_,
  2377. `#1667 <https://github.com/fmtlib/fmt/pull/1667>`_,
  2378. `#1668 <https://github.com/fmtlib/fmt/issues/1668>`_,
  2379. `#1669 <https://github.com/fmtlib/fmt/pull/1669>`_,
  2380. `#1692 <https://github.com/fmtlib/fmt/issues/1692>`_,
  2381. `#1696 <https://github.com/fmtlib/fmt/pull/1696>`_,
  2382. `#1697 <https://github.com/fmtlib/fmt/pull/1697>`_,
  2383. `#1707 <https://github.com/fmtlib/fmt/issues/1707>`_,
  2384. `#1712 <https://github.com/fmtlib/fmt/pull/1712>`_,
  2385. `#1716 <https://github.com/fmtlib/fmt/pull/1716>`_,
  2386. `#1722 <https://github.com/fmtlib/fmt/pull/1722>`_,
  2387. `#1724 <https://github.com/fmtlib/fmt/issues/1724>`_,
  2388. `#1729 <https://github.com/fmtlib/fmt/pull/1729>`_,
  2389. `#1738 <https://github.com/fmtlib/fmt/pull/1738>`_,
  2390. `#1742 <https://github.com/fmtlib/fmt/issues/1742>`_,
  2391. `#1743 <https://github.com/fmtlib/fmt/issues/1743>`_,
  2392. `#1744 <https://github.com/fmtlib/fmt/pull/1744>`_,
  2393. `#1747 <https://github.com/fmtlib/fmt/issues/1747>`_,
  2394. `#1750 <https://github.com/fmtlib/fmt/pull/1750>`_).
  2395. Thanks `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  2396. `@gabime (Gabi Melman) <https://github.com/gabime>`_,
  2397. `@johnor (Johan) <https://github.com/johnor>`_,
  2398. `@Kurkin (Dmitry Kurkin) <https://github.com/Kurkin>`_,
  2399. `@invexed (James Beach) <https://github.com/invexed>`_,
  2400. `@peterbell10 <https://github.com/peterbell10>`_,
  2401. `@daixtrose (Markus Werle) <https://github.com/daixtrose>`_,
  2402. `@petrutlucian94 (Lucian Petrut) <https://github.com/petrutlucian94>`_,
  2403. `@Neargye (Daniil Goncharov) <https://github.com/Neargye>`_,
  2404. `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_,
  2405. `@gabime (Gabi Melman) <https://github.com/gabime>`_,
  2406. `@erthink (Leonid Yuriev) <https://github.com/erthink>`_,
  2407. `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_,
  2408. `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_.
  2409. 6.2.1 - 2020-05-09
  2410. ------------------
  2411. * Fixed ostream support in ``sprintf``
  2412. (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_).
  2413. * Fixed type detection when using implicit conversion to ``string_view`` and
  2414. ostream ``operator<<`` inconsistently
  2415. (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_).
  2416. 6.2.0 - 2020-04-05
  2417. ------------------
  2418. * Improved error reporting when trying to format an object of a non-formattable
  2419. type:
  2420. .. code:: c++
  2421. fmt::format("{}", S());
  2422. now gives::
  2423. include/fmt/core.h:1015:5: error: static_assert failed due to requirement
  2424. 'formattable' "Cannot format argument. To make type T formattable provide a
  2425. formatter<T> specialization:
  2426. https://fmt.dev/latest/api.html#formatting-user-defined-types"
  2427. static_assert(
  2428. ^
  2429. ...
  2430. note: in instantiation of function template specialization
  2431. 'fmt::v6::format<char [3], S, char>' requested here
  2432. fmt::format("{}", S());
  2433. ^
  2434. if ``S`` is not formattable.
  2435. * Reduced the library size by ~10%.
  2436. * Always print decimal point if ``#`` is specified
  2437. (`#1476 <https://github.com/fmtlib/fmt/issues/1476>`_,
  2438. `#1498 <https://github.com/fmtlib/fmt/issues/1498>`_):
  2439. .. code:: c++
  2440. fmt::print("{:#.0f}", 42.0);
  2441. now prints ``42.``
  2442. * Implemented the ``'L'`` specifier for locale-specific numeric formatting to
  2443. improve compatibility with ``std::format``. The ``'n'`` specifier is now
  2444. deprecated and will be removed in the next major release.
  2445. * Moved OS-specific APIs such as ``windows_error`` from ``fmt/format.h`` to
  2446. ``fmt/os.h``. You can define ``FMT_DEPRECATED_INCLUDE_OS`` to automatically
  2447. include ``fmt/os.h`` from ``fmt/format.h`` for compatibility but this will be
  2448. disabled in the next major release.
  2449. * Added precision overflow detection in floating-point formatting.
  2450. * Implemented detection of invalid use of ``fmt::arg``.
  2451. * Used ``type_identity`` to block unnecessary template argument deduction.
  2452. Thanks Tim Song.
  2453. * Improved UTF-8 handling
  2454. (`#1109 <https://github.com/fmtlib/fmt/issues/1109>`_):
  2455. .. code:: c++
  2456. fmt::print("┌{0:─^{2}}┐\n"
  2457. "│{1: ^{2}}│\n"
  2458. "└{0:─^{2}}┘\n", "", "Привет, мир!", 20);
  2459. now prints::
  2460. ┌────────────────────┐
  2461. │ Привет, мир! │
  2462. └────────────────────┘
  2463. on systems that support Unicode.
  2464. * Added experimental dynamic argument storage
  2465. (`#1170 <https://github.com/fmtlib/fmt/issues/1170>`_,
  2466. `#1584 <https://github.com/fmtlib/fmt/pull/1584>`_):
  2467. .. code:: c++
  2468. fmt::dynamic_format_arg_store<fmt::format_context> store;
  2469. store.push_back("answer");
  2470. store.push_back(42);
  2471. fmt::vprint("The {} is {}.\n", store);
  2472. prints::
  2473. The answer is 42.
  2474. Thanks `@vsolontsov-ll (Vladimir Solontsov)
  2475. <https://github.com/vsolontsov-ll>`_.
  2476. * Made ``fmt::join`` accept ``initializer_list``
  2477. (`#1591 <https://github.com/fmtlib/fmt/pull/1591>`_).
  2478. Thanks `@Rapotkinnik (Nikolay Rapotkin) <https://github.com/Rapotkinnik>`_.
  2479. * Fixed handling of empty tuples
  2480. (`#1588 <https://github.com/fmtlib/fmt/issues/1588>`_).
  2481. * Fixed handling of output iterators in ``format_to_n``
  2482. (`#1506 <https://github.com/fmtlib/fmt/issues/1506>`_).
  2483. * Fixed formatting of ``std::chrono::duration`` types to wide output
  2484. (`#1533 <https://github.com/fmtlib/fmt/pull/1533>`_).
  2485. Thanks `@zeffy (pilao) <https://github.com/zeffy>`_.
  2486. * Added const ``begin`` and ``end`` overload to buffers
  2487. (`#1553 <https://github.com/fmtlib/fmt/pull/1553>`_).
  2488. Thanks `@dominicpoeschko <https://github.com/dominicpoeschko>`_.
  2489. * Added the ability to disable floating-point formatting via ``FMT_USE_FLOAT``,
  2490. ``FMT_USE_DOUBLE`` and ``FMT_USE_LONG_DOUBLE`` macros for extremely
  2491. memory-constrained embedded system
  2492. (`#1590 <https://github.com/fmtlib/fmt/pull/1590>`_).
  2493. Thanks `@albaguirre (Alberto Aguirre) <https://github.com/albaguirre>`_.
  2494. * Made ``FMT_STRING`` work with ``constexpr`` ``string_view``
  2495. (`#1589 <https://github.com/fmtlib/fmt/pull/1589>`_).
  2496. Thanks `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_.
  2497. * Implemented a minor optimization in the format string parser
  2498. (`#1560 <https://github.com/fmtlib/fmt/pull/1560>`_).
  2499. Thanks `@IkarusDeveloper <https://github.com/IkarusDeveloper>`_.
  2500. * Improved attribute detection
  2501. (`#1469 <https://github.com/fmtlib/fmt/pull/1469>`_,
  2502. `#1475 <https://github.com/fmtlib/fmt/pull/1475>`_,
  2503. `#1576 <https://github.com/fmtlib/fmt/pull/1576>`_).
  2504. Thanks `@federico-busato (Federico) <https://github.com/federico-busato>`_,
  2505. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  2506. `@refnum <https://github.com/refnum>`_.
  2507. * Improved documentation
  2508. (`#1481 <https://github.com/fmtlib/fmt/pull/1481>`_,
  2509. `#1523 <https://github.com/fmtlib/fmt/pull/1523>`_).
  2510. Thanks `@JackBoosY (Jack·Boos·Yu) <https://github.com/JackBoosY>`_,
  2511. `@imba-tjd (谭九鼎) <https://github.com/imba-tjd>`_.
  2512. * Fixed symbol visibility on Linux when compiling with ``-fvisibility=hidden``
  2513. (`#1535 <https://github.com/fmtlib/fmt/pull/1535>`_).
  2514. Thanks `@milianw (Milian Wolff) <https://github.com/milianw>`_.
  2515. * Implemented various build configuration fixes and improvements
  2516. (`#1264 <https://github.com/fmtlib/fmt/issues/1264>`_,
  2517. `#1460 <https://github.com/fmtlib/fmt/issues/1460>`_,
  2518. `#1534 <https://github.com/fmtlib/fmt/pull/1534>`_,
  2519. `#1536 <https://github.com/fmtlib/fmt/issues/1536>`_,
  2520. `#1545 <https://github.com/fmtlib/fmt/issues/1545>`_,
  2521. `#1546 <https://github.com/fmtlib/fmt/pull/1546>`_,
  2522. `#1566 <https://github.com/fmtlib/fmt/issues/1566>`_,
  2523. `#1582 <https://github.com/fmtlib/fmt/pull/1582>`_,
  2524. `#1597 <https://github.com/fmtlib/fmt/issues/1597>`_,
  2525. `#1598 <https://github.com/fmtlib/fmt/pull/1598>`_).
  2526. Thanks `@ambitslix (Attila M. Szilagyi) <https://github.com/ambitslix>`_,
  2527. `@jwillikers (Jordan Williams) <https://github.com/jwillikers>`_,
  2528. `@stac47 (Laurent Stacul) <https://github.com/stac47>`_.
  2529. * Fixed various warnings and compilation issues
  2530. (`#1433 <https://github.com/fmtlib/fmt/pull/1433>`_,
  2531. `#1461 <https://github.com/fmtlib/fmt/issues/1461>`_,
  2532. `#1470 <https://github.com/fmtlib/fmt/pull/1470>`_,
  2533. `#1480 <https://github.com/fmtlib/fmt/pull/1480>`_,
  2534. `#1485 <https://github.com/fmtlib/fmt/pull/1485>`_,
  2535. `#1492 <https://github.com/fmtlib/fmt/pull/1492>`_,
  2536. `#1493 <https://github.com/fmtlib/fmt/issues/1493>`_,
  2537. `#1504 <https://github.com/fmtlib/fmt/issues/1504>`_,
  2538. `#1505 <https://github.com/fmtlib/fmt/pull/1505>`_,
  2539. `#1512 <https://github.com/fmtlib/fmt/pull/1512>`_,
  2540. `#1515 <https://github.com/fmtlib/fmt/issues/1515>`_,
  2541. `#1516 <https://github.com/fmtlib/fmt/pull/1516>`_,
  2542. `#1518 <https://github.com/fmtlib/fmt/pull/1518>`_,
  2543. `#1519 <https://github.com/fmtlib/fmt/pull/1519>`_,
  2544. `#1520 <https://github.com/fmtlib/fmt/pull/1520>`_,
  2545. `#1521 <https://github.com/fmtlib/fmt/pull/1521>`_,
  2546. `#1522 <https://github.com/fmtlib/fmt/pull/1522>`_,
  2547. `#1524 <https://github.com/fmtlib/fmt/issues/1524>`_,
  2548. `#1530 <https://github.com/fmtlib/fmt/pull/1530>`_,
  2549. `#1531 <https://github.com/fmtlib/fmt/issues/1531>`_,
  2550. `#1532 <https://github.com/fmtlib/fmt/pull/1532>`_,
  2551. `#1539 <https://github.com/fmtlib/fmt/issues/1539>`_,
  2552. `#1547 <https://github.com/fmtlib/fmt/issues/1547>`_,
  2553. `#1548 <https://github.com/fmtlib/fmt/issues/1548>`_,
  2554. `#1554 <https://github.com/fmtlib/fmt/pull/1554>`_,
  2555. `#1567 <https://github.com/fmtlib/fmt/issues/1567>`_,
  2556. `#1568 <https://github.com/fmtlib/fmt/pull/1568>`_,
  2557. `#1569 <https://github.com/fmtlib/fmt/pull/1569>`_,
  2558. `#1571 <https://github.com/fmtlib/fmt/pull/1571>`_,
  2559. `#1573 <https://github.com/fmtlib/fmt/pull/1573>`_,
  2560. `#1575 <https://github.com/fmtlib/fmt/pull/1575>`_,
  2561. `#1581 <https://github.com/fmtlib/fmt/pull/1581>`_,
  2562. `#1583 <https://github.com/fmtlib/fmt/issues/1583>`_,
  2563. `#1586 <https://github.com/fmtlib/fmt/issues/1586>`_,
  2564. `#1587 <https://github.com/fmtlib/fmt/issues/1587>`_,
  2565. `#1594 <https://github.com/fmtlib/fmt/issues/1594>`_,
  2566. `#1596 <https://github.com/fmtlib/fmt/pull/1596>`_,
  2567. `#1604 <https://github.com/fmtlib/fmt/issues/1604>`_,
  2568. `#1606 <https://github.com/fmtlib/fmt/pull/1606>`_,
  2569. `#1607 <https://github.com/fmtlib/fmt/issues/1607>`_,
  2570. `#1609 <https://github.com/fmtlib/fmt/issues/1609>`_).
  2571. Thanks `@marti4d (Chris Martin) <https://github.com/marti4d>`_,
  2572. `@iPherian <https://github.com/iPherian>`_,
  2573. `@parkertomatoes <https://github.com/parkertomatoes>`_,
  2574. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  2575. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  2576. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  2577. `@torsten48 <https://github.com/torsten48>`_,
  2578. `@tohammer (Tobias Hammer) <https://github.com/tohammer>`_,
  2579. `@lefticus (Jason Turner) <https://github.com/lefticus>`_,
  2580. `@ryusakki (Haise) <https://github.com/ryusakki>`_,
  2581. `@adnsv (Alex Denisov) <https://github.com/adnsv>`_,
  2582. `@fghzxm <https://github.com/fghzxm>`_,
  2583. `@refnum <https://github.com/refnum>`_,
  2584. `@pramodk (Pramod Kumbhar) <https://github.com/pramodk>`_,
  2585. `@Spirrwell <https://github.com/Spirrwell>`_,
  2586. `@scramsby (Scott Ramsby) <https://github.com/scramsby>`_.
  2587. 6.1.2 - 2019-12-11
  2588. ------------------
  2589. * Fixed ABI compatibility with ``libfmt.so.6.0.0``
  2590. (`#1471 <https://github.com/fmtlib/fmt/issues/1471>`_).
  2591. * Fixed handling types convertible to ``std::string_view``
  2592. (`#1451 <https://github.com/fmtlib/fmt/pull/1451>`_).
  2593. Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_.
  2594. * Made CUDA test an opt-in enabled via the ``FMT_CUDA_TEST`` CMake option.
  2595. * Fixed sign conversion warnings
  2596. (`#1440 <https://github.com/fmtlib/fmt/pull/1440>`_).
  2597. Thanks `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_.
  2598. 6.1.1 - 2019-12-04
  2599. ------------------
  2600. * Fixed shared library build on Windows
  2601. (`#1443 <https://github.com/fmtlib/fmt/pull/1443>`_,
  2602. `#1445 <https://github.com/fmtlib/fmt/issues/1445>`_,
  2603. `#1446 <https://github.com/fmtlib/fmt/pull/1446>`_,
  2604. `#1450 <https://github.com/fmtlib/fmt/issues/1450>`_).
  2605. Thanks `@egorpugin (Egor Pugin) <https://github.com/egorpugin>`_,
  2606. `@bbolli (Beat Bolli) <https://github.com/bbolli>`_.
  2607. * Added a missing decimal point in exponent notation with trailing zeros.
  2608. * Removed deprecated ``format_arg_store::TYPES``.
  2609. 6.1.0 - 2019-12-01
  2610. ------------------
  2611. * {fmt} now formats IEEE 754 ``float`` and ``double`` using the shortest decimal
  2612. representation with correct rounding by default:
  2613. .. code:: c++
  2614. #include <cmath>
  2615. #include <fmt/core.h>
  2616. int main() {
  2617. fmt::print("{}", M_PI);
  2618. }
  2619. prints ``3.141592653589793``.
  2620. * Made the fast binary to decimal floating-point formatter the default,
  2621. simplified it and improved performance. {fmt} is now 15 times faster than
  2622. libc++'s ``std::ostringstream``, 11 times faster than ``printf`` and 10%
  2623. faster than double-conversion on `dtoa-benchmark
  2624. <https://github.com/fmtlib/dtoa-benchmark>`_:
  2625. ================== ========= =======
  2626. Function Time (ns) Speedup
  2627. ================== ========= =======
  2628. ostringstream 1,346.30 1.00x
  2629. ostrstream 1,195.74 1.13x
  2630. sprintf 995.08 1.35x
  2631. doubleconv 99.10 13.59x
  2632. fmt 88.34 15.24x
  2633. ================== ========= =======
  2634. .. image:: https://user-images.githubusercontent.com/576385/
  2635. 69767160-cdaca400-112f-11ea-9fc5-347c9f83caad.png
  2636. * {fmt} no longer converts ``float`` arguments to ``double``. In particular this
  2637. improves the default (shortest) representation of floats and makes
  2638. ``fmt::format`` consistent with ``std::format`` specs
  2639. (`#1336 <https://github.com/fmtlib/fmt/issues/1336>`_,
  2640. `#1353 <https://github.com/fmtlib/fmt/issues/1353>`_,
  2641. `#1360 <https://github.com/fmtlib/fmt/pull/1360>`_,
  2642. `#1361 <https://github.com/fmtlib/fmt/pull/1361>`_):
  2643. .. code:: c++
  2644. fmt::print("{}", 0.1f);
  2645. prints ``0.1`` instead of ``0.10000000149011612``.
  2646. Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_.
  2647. * Made floating-point formatting output consistent with ``printf``/iostreams
  2648. (`#1376 <https://github.com/fmtlib/fmt/issues/1376>`_,
  2649. `#1417 <https://github.com/fmtlib/fmt/issues/1417>`_).
  2650. * Added support for 128-bit integers
  2651. (`#1287 <https://github.com/fmtlib/fmt/pull/1287>`_):
  2652. .. code:: c++
  2653. fmt::print("{}", std::numeric_limits<__int128_t>::max());
  2654. prints ``170141183460469231731687303715884105727``.
  2655. Thanks `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_.
  2656. * The overload of ``print`` that takes ``text_style`` is now atomic, i.e. the
  2657. output from different threads doesn't interleave
  2658. (`#1351 <https://github.com/fmtlib/fmt/pull/1351>`_).
  2659. Thanks `@tankiJong (Tanki Zhang) <https://github.com/tankiJong>`_.
  2660. * Made compile time in the header-only mode ~20% faster by reducing the number
  2661. of template instantiations. ``wchar_t`` overload of ``vprint`` was moved from
  2662. ``fmt/core.h`` to ``fmt/format.h``.
  2663. * Added an overload of ``fmt::join`` that works with tuples
  2664. (`#1322 <https://github.com/fmtlib/fmt/issues/1322>`_,
  2665. `#1330 <https://github.com/fmtlib/fmt/pull/1330>`_):
  2666. .. code:: c++
  2667. #include <tuple>
  2668. #include <fmt/ranges.h>
  2669. int main() {
  2670. std::tuple<char, int, float> t{'a', 1, 2.0f};
  2671. fmt::print("{}", t);
  2672. }
  2673. prints ``('a', 1, 2.0)``.
  2674. Thanks `@jeremyong (Jeremy Ong) <https://github.com/jeremyong>`_.
  2675. * Changed formatting of octal zero with prefix from "00" to "0":
  2676. .. code:: c++
  2677. fmt::print("{:#o}", 0);
  2678. prints ``0``.
  2679. * The locale is now passed to ostream insertion (``<<``) operators
  2680. (`#1406 <https://github.com/fmtlib/fmt/pull/1406>`_):
  2681. .. code:: c++
  2682. #include <fmt/locale.h>
  2683. #include <fmt/ostream.h>
  2684. struct S {
  2685. double value;
  2686. };
  2687. std::ostream& operator<<(std::ostream& os, S s) {
  2688. return os << s.value;
  2689. }
  2690. int main() {
  2691. auto s = fmt::format(std::locale("fr_FR.UTF-8"), "{}", S{0.42});
  2692. // s == "0,42"
  2693. }
  2694. Thanks `@dlaugt (Daniel Laügt) <https://github.com/dlaugt>`_.
  2695. * Locale-specific number formatting now uses grouping
  2696. (`#1393 <https://github.com/fmtlib/fmt/issues/1393>`_
  2697. `#1394 <https://github.com/fmtlib/fmt/pull/1394>`_).
  2698. Thanks `@skrdaniel <https://github.com/skrdaniel>`_.
  2699. * Fixed handling of types with deleted implicit rvalue conversion to
  2700. ``const char**`` (`#1421 <https://github.com/fmtlib/fmt/issues/1421>`_):
  2701. .. code:: c++
  2702. struct mystring {
  2703. operator const char*() const&;
  2704. operator const char*() &;
  2705. operator const char*() const&& = delete;
  2706. operator const char*() && = delete;
  2707. };
  2708. mystring str;
  2709. fmt::print("{}", str); // now compiles
  2710. * Enums are now mapped to correct underlying types instead of ``int``
  2711. (`#1286 <https://github.com/fmtlib/fmt/pull/1286>`_).
  2712. Thanks `@agmt (Egor Seredin) <https://github.com/agmt>`_.
  2713. * Enum classes are no longer implicitly converted to ``int``
  2714. (`#1424 <https://github.com/fmtlib/fmt/issues/1424>`_).
  2715. * Added ``basic_format_parse_context`` for consistency with C++20
  2716. ``std::format`` and deprecated ``basic_parse_context``.
  2717. * Fixed handling of UTF-8 in precision
  2718. (`#1389 <https://github.com/fmtlib/fmt/issues/1389>`_,
  2719. `#1390 <https://github.com/fmtlib/fmt/pull/1390>`_).
  2720. Thanks `@tajtiattila (Attila Tajti) <https://github.com/tajtiattila>`_.
  2721. * {fmt} can now be installed on Linux, macOS and Windows with
  2722. `Conda <https://docs.conda.io/en/latest/>`__ using its
  2723. `conda-forge <https://conda-forge.org>`__
  2724. `package <https://github.com/conda-forge/fmt-feedstock>`__
  2725. (`#1410 <https://github.com/fmtlib/fmt/pull/1410>`_)::
  2726. conda install -c conda-forge fmt
  2727. Thanks `@tdegeus (Tom de Geus) <https://github.com/tdegeus>`_.
  2728. * Added a CUDA test (`#1285 <https://github.com/fmtlib/fmt/pull/1285>`_,
  2729. `#1317 <https://github.com/fmtlib/fmt/pull/1317>`_).
  2730. Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_ and
  2731. `@risa2000 <https://github.com/risa2000>`_.
  2732. * Improved documentation (`#1276 <https://github.com/fmtlib/fmt/pull/1276>`_,
  2733. `#1291 <https://github.com/fmtlib/fmt/issues/1291>`_,
  2734. `#1296 <https://github.com/fmtlib/fmt/issues/1296>`_,
  2735. `#1315 <https://github.com/fmtlib/fmt/pull/1315>`_,
  2736. `#1332 <https://github.com/fmtlib/fmt/pull/1332>`_,
  2737. `#1337 <https://github.com/fmtlib/fmt/pull/1337>`_,
  2738. `#1395 <https://github.com/fmtlib/fmt/issues/1395>`_
  2739. `#1418 <https://github.com/fmtlib/fmt/pull/1418>`_).
  2740. Thanks
  2741. `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_,
  2742. `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_,
  2743. `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
  2744. * Various code improvements
  2745. (`#1358 <https://github.com/fmtlib/fmt/pull/1358>`_,
  2746. `#1407 <https://github.com/fmtlib/fmt/pull/1407>`_).
  2747. Thanks `@orivej (Orivej Desh) <https://github.com/orivej>`_,
  2748. `@dpacbach (David P. Sicilia) <https://github.com/dpacbach>`_,
  2749. * Fixed compile-time format string checks for user-defined types
  2750. (`#1292 <https://github.com/fmtlib/fmt/issues/1292>`_).
  2751. * Worked around a false positive in ``unsigned-integer-overflow`` sanitizer
  2752. (`#1377 <https://github.com/fmtlib/fmt/issues/1377>`_).
  2753. * Fixed various warnings and compilation issues
  2754. (`#1273 <https://github.com/fmtlib/fmt/issues/1273>`_,
  2755. `#1278 <https://github.com/fmtlib/fmt/pull/1278>`_,
  2756. `#1280 <https://github.com/fmtlib/fmt/pull/1280>`_,
  2757. `#1281 <https://github.com/fmtlib/fmt/issues/1281>`_,
  2758. `#1288 <https://github.com/fmtlib/fmt/issues/1288>`_,
  2759. `#1290 <https://github.com/fmtlib/fmt/pull/1290>`_,
  2760. `#1301 <https://github.com/fmtlib/fmt/pull/1301>`_,
  2761. `#1305 <https://github.com/fmtlib/fmt/issues/1305>`_,
  2762. `#1306 <https://github.com/fmtlib/fmt/issues/1306>`_,
  2763. `#1309 <https://github.com/fmtlib/fmt/issues/1309>`_,
  2764. `#1312 <https://github.com/fmtlib/fmt/pull/1312>`_,
  2765. `#1313 <https://github.com/fmtlib/fmt/issues/1313>`_,
  2766. `#1316 <https://github.com/fmtlib/fmt/issues/1316>`_,
  2767. `#1319 <https://github.com/fmtlib/fmt/issues/1319>`_,
  2768. `#1320 <https://github.com/fmtlib/fmt/pull/1320>`_,
  2769. `#1326 <https://github.com/fmtlib/fmt/pull/1326>`_,
  2770. `#1328 <https://github.com/fmtlib/fmt/pull/1328>`_,
  2771. `#1344 <https://github.com/fmtlib/fmt/issues/1344>`_,
  2772. `#1345 <https://github.com/fmtlib/fmt/pull/1345>`_,
  2773. `#1347 <https://github.com/fmtlib/fmt/pull/1347>`_,
  2774. `#1349 <https://github.com/fmtlib/fmt/pull/1349>`_,
  2775. `#1354 <https://github.com/fmtlib/fmt/issues/1354>`_,
  2776. `#1362 <https://github.com/fmtlib/fmt/issues/1362>`_,
  2777. `#1366 <https://github.com/fmtlib/fmt/issues/1366>`_,
  2778. `#1364 <https://github.com/fmtlib/fmt/pull/1364>`_,
  2779. `#1370 <https://github.com/fmtlib/fmt/pull/1370>`_,
  2780. `#1371 <https://github.com/fmtlib/fmt/pull/1371>`_,
  2781. `#1385 <https://github.com/fmtlib/fmt/issues/1385>`_,
  2782. `#1388 <https://github.com/fmtlib/fmt/issues/1388>`_,
  2783. `#1397 <https://github.com/fmtlib/fmt/pull/1397>`_,
  2784. `#1414 <https://github.com/fmtlib/fmt/pull/1414>`_,
  2785. `#1416 <https://github.com/fmtlib/fmt/pull/1416>`_,
  2786. `#1422 <https://github.com/fmtlib/fmt/issues/1422>`_
  2787. `#1427 <https://github.com/fmtlib/fmt/pull/1427>`_,
  2788. `#1431 <https://github.com/fmtlib/fmt/issues/1431>`_,
  2789. `#1433 <https://github.com/fmtlib/fmt/pull/1433>`_).
  2790. Thanks `@hhb <https://github.com/hhb>`_,
  2791. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  2792. `@gabime (Gabi Melman) <https://github.com/gabime>`_,
  2793. `@neheb (Rosen Penev) <https://github.com/neheb>`_,
  2794. `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_,
  2795. `@dkavolis (Daumantas Kavolis) <https://github.com/dkavolis>`_,
  2796. `@mwinterb <https://github.com/mwinterb>`_,
  2797. `@orivej (Orivej Desh) <https://github.com/orivej>`_,
  2798. `@denizevrenci (Deniz Evrenci) <https://github.com/denizevrenci>`_
  2799. `@leonklingele <https://github.com/leonklingele>`_,
  2800. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  2801. `@kent-tri <https://github.com/kent-tri>`_,
  2802. `@0x8000-0000 (Florin Iucha) <https://github.com/0x8000-0000>`_,
  2803. `@marti4d (Chris Martin) <https://github.com/marti4d>`_.
  2804. 6.0.0 - 2019-08-26
  2805. ------------------
  2806. * Switched to the `MIT license
  2807. <https://github.com/fmtlib/fmt/blob/5a4b24613ba16cc689977c3b5bd8274a3ba1dd1f/LICENSE.rst>`_
  2808. with an optional exception that allows distributing binary code without
  2809. attribution.
  2810. * Floating-point formatting is now locale-independent by default:
  2811. .. code:: c++
  2812. #include <locale>
  2813. #include <fmt/core.h>
  2814. int main() {
  2815. std::locale::global(std::locale("ru_RU.UTF-8"));
  2816. fmt::print("value = {}", 4.2);
  2817. }
  2818. prints "value = 4.2" regardless of the locale.
  2819. For locale-specific formatting use the ``n`` specifier:
  2820. .. code:: c++
  2821. std::locale::global(std::locale("ru_RU.UTF-8"));
  2822. fmt::print("value = {:n}", 4.2);
  2823. prints "value = 4,2".
  2824. * Added an experimental Grisu floating-point formatting algorithm
  2825. implementation (disabled by default). To enable it compile with the
  2826. ``FMT_USE_GRISU`` macro defined to 1:
  2827. .. code:: c++
  2828. #define FMT_USE_GRISU 1
  2829. #include <fmt/format.h>
  2830. auto s = fmt::format("{}", 4.2); // formats 4.2 using Grisu
  2831. With Grisu enabled, {fmt} is 13x faster than ``std::ostringstream`` (libc++)
  2832. and 10x faster than ``sprintf`` on `dtoa-benchmark
  2833. <https://github.com/fmtlib/dtoa-benchmark>`_ (`full results
  2834. <https://fmt.dev/unknown_mac64_clang10.0.html>`_):
  2835. .. image:: https://user-images.githubusercontent.com/576385/
  2836. 54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg
  2837. * Separated formatting and parsing contexts for consistency with
  2838. `C++20 std::format <http://eel.is/c++draft/format>`_, removing the
  2839. undocumented ``basic_format_context::parse_context()`` function.
  2840. * Added `oss-fuzz <https://github.com/google/oss-fuzz>`_ support
  2841. (`#1199 <https://github.com/fmtlib/fmt/pull/1199>`_).
  2842. Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
  2843. * ``formatter`` specializations now always take precedence over ``operator<<``
  2844. (`#952 <https://github.com/fmtlib/fmt/issues/952>`_):
  2845. .. code:: c++
  2846. #include <iostream>
  2847. #include <fmt/ostream.h>
  2848. struct S {};
  2849. std::ostream& operator<<(std::ostream& os, S) {
  2850. return os << 1;
  2851. }
  2852. template <>
  2853. struct fmt::formatter<S> : fmt::formatter<int> {
  2854. auto format(S, format_context& ctx) {
  2855. return formatter<int>::format(2, ctx);
  2856. }
  2857. };
  2858. int main() {
  2859. std::cout << S() << "\n"; // prints 1 using operator<<
  2860. fmt::print("{}\n", S()); // prints 2 using formatter
  2861. }
  2862. * Introduced the experimental ``fmt::compile`` function that does format string
  2863. compilation (`#618 <https://github.com/fmtlib/fmt/issues/618>`_,
  2864. `#1169 <https://github.com/fmtlib/fmt/issues/1169>`_,
  2865. `#1171 <https://github.com/fmtlib/fmt/pull/1171>`_):
  2866. .. code:: c++
  2867. #include <fmt/compile.h>
  2868. auto f = fmt::compile<int>("{}");
  2869. std::string s = fmt::format(f, 42); // can be called multiple times to
  2870. // format different values
  2871. // s == "42"
  2872. It moves the cost of parsing a format string outside of the format function
  2873. which can be beneficial when identically formatting many objects of the same
  2874. types. Thanks `@stryku (Mateusz Janek) <https://github.com/stryku>`_.
  2875. * Added experimental ``%`` format specifier that formats floating-point values
  2876. as percentages (`#1060 <https://github.com/fmtlib/fmt/pull/1060>`_,
  2877. `#1069 <https://github.com/fmtlib/fmt/pull/1069>`_,
  2878. `#1071 <https://github.com/fmtlib/fmt/pull/1071>`_):
  2879. .. code:: c++
  2880. auto s = fmt::format("{:.1%}", 0.42); // s == "42.0%"
  2881. Thanks `@gawain-bolton (Gawain Bolton) <https://github.com/gawain-bolton>`_.
  2882. * Implemented precision for floating-point durations
  2883. (`#1004 <https://github.com/fmtlib/fmt/issues/1004>`_,
  2884. `#1012 <https://github.com/fmtlib/fmt/pull/1012>`_):
  2885. .. code:: c++
  2886. auto s = fmt::format("{:.1}", std::chrono::duration<double>(1.234));
  2887. // s == 1.2s
  2888. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  2889. * Implemented ``chrono`` format specifiers ``%Q`` and ``%q`` that give the value
  2890. and the unit respectively (`#1019 <https://github.com/fmtlib/fmt/pull/1019>`_):
  2891. .. code:: c++
  2892. auto value = fmt::format("{:%Q}", 42s); // value == "42"
  2893. auto unit = fmt::format("{:%q}", 42s); // unit == "s"
  2894. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  2895. * Fixed handling of dynamic width in chrono formatter:
  2896. .. code:: c++
  2897. auto s = fmt::format("{0:{1}%H:%M:%S}", std::chrono::seconds(12345), 12);
  2898. // ^ width argument index ^ width
  2899. // s == "03:25:45 "
  2900. Thanks Howard Hinnant.
  2901. * Removed deprecated ``fmt/time.h``. Use ``fmt/chrono.h`` instead.
  2902. * Added ``fmt::format`` and ``fmt::vformat`` overloads that take ``text_style``
  2903. (`#993 <https://github.com/fmtlib/fmt/issues/993>`_,
  2904. `#994 <https://github.com/fmtlib/fmt/pull/994>`_):
  2905. .. code:: c++
  2906. #include <fmt/color.h>
  2907. std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red),
  2908. "The answer is {}.", 42);
  2909. Thanks `@Naios (Denis Blank) <https://github.com/Naios>`_.
  2910. * Removed the deprecated color API (``print_colored``). Use the new API, namely
  2911. ``print`` overloads that take ``text_style`` instead.
  2912. * Made ``std::unique_ptr`` and ``std::shared_ptr`` formattable as pointers via
  2913. ``fmt::ptr`` (`#1121 <https://github.com/fmtlib/fmt/pull/1121>`_):
  2914. .. code:: c++
  2915. std::unique_ptr<int> p = ...;
  2916. fmt::print("{}", fmt::ptr(p)); // prints p as a pointer
  2917. Thanks `@sighingnow (Tao He) <https://github.com/sighingnow>`_.
  2918. * Made ``print`` and ``vprint`` report I/O errors
  2919. (`#1098 <https://github.com/fmtlib/fmt/issues/1098>`_,
  2920. `#1099 <https://github.com/fmtlib/fmt/pull/1099>`_).
  2921. Thanks `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_.
  2922. * Marked deprecated APIs with the ``[[deprecated]]`` attribute and removed
  2923. internal uses of deprecated APIs
  2924. (`#1022 <https://github.com/fmtlib/fmt/pull/1022>`_).
  2925. Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_.
  2926. * Modernized the codebase using more C++11 features and removing workarounds.
  2927. Most importantly, ``buffer_context`` is now an alias template, so
  2928. use ``buffer_context<T>`` instead of ``buffer_context<T>::type``.
  2929. These features require GCC 4.8 or later.
  2930. * ``formatter`` specializations now always take precedence over implicit
  2931. conversions to ``int`` and the undocumented ``convert_to_int`` trait
  2932. is now deprecated.
  2933. * Moved the undocumented ``basic_writer``, ``writer``, and ``wwriter`` types
  2934. to the ``internal`` namespace.
  2935. * Removed deprecated ``basic_format_context::begin()``. Use ``out()`` instead.
  2936. * Disallowed passing the result of ``join`` as an lvalue to prevent misuse.
  2937. * Refactored the undocumented structs that represent parsed format specifiers
  2938. to simplify the API and allow multibyte fill.
  2939. * Moved SFINAE to template parameters to reduce symbol sizes.
  2940. * Switched to ``fputws`` for writing wide strings so that it's no longer
  2941. required to call ``_setmode`` on Windows
  2942. (`#1229 <https://github.com/fmtlib/fmt/issues/1229>`_,
  2943. `#1243 <https://github.com/fmtlib/fmt/pull/1243>`_).
  2944. Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
  2945. * Improved literal-based API
  2946. (`#1254 <https://github.com/fmtlib/fmt/pull/1254>`_).
  2947. Thanks `@sylveon (Charles Milette) <https://github.com/sylveon>`_.
  2948. * Added support for exotic platforms without ``uintptr_t`` such as IBM i
  2949. (AS/400) which has 128-bit pointers and only 64-bit integers
  2950. (`#1059 <https://github.com/fmtlib/fmt/issues/1059>`_).
  2951. * Added `Sublime Text syntax highlighting config
  2952. <https://github.com/fmtlib/fmt/blob/master/support/C%2B%2B.sublime-syntax>`_
  2953. (`#1037 <https://github.com/fmtlib/fmt/issues/1037>`_).
  2954. Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_.
  2955. * Added the ``FMT_ENFORCE_COMPILE_STRING`` macro to enforce the use of
  2956. compile-time format strings
  2957. (`#1231 <https://github.com/fmtlib/fmt/pull/1231>`_).
  2958. Thanks `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_.
  2959. * Stopped setting ``CMAKE_BUILD_TYPE`` if {fmt} is a subproject
  2960. (`#1081 <https://github.com/fmtlib/fmt/issues/1081>`_).
  2961. * Various build improvements
  2962. (`#1039 <https://github.com/fmtlib/fmt/pull/1039>`_,
  2963. `#1078 <https://github.com/fmtlib/fmt/pull/1078>`_,
  2964. `#1091 <https://github.com/fmtlib/fmt/pull/1091>`_,
  2965. `#1103 <https://github.com/fmtlib/fmt/pull/1103>`_,
  2966. `#1177 <https://github.com/fmtlib/fmt/pull/1177>`_).
  2967. Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_,
  2968. `@jasonszang (Jason Shuo Zang) <https://github.com/jasonszang>`_,
  2969. `@olafhering (Olaf Hering) <https://github.com/olafhering>`_,
  2970. `@Lecetem <https://github.com/Lectem>`_,
  2971. `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
  2972. * Improved documentation
  2973. (`#1049 <https://github.com/fmtlib/fmt/issues/1049>`_,
  2974. `#1051 <https://github.com/fmtlib/fmt/pull/1051>`_,
  2975. `#1083 <https://github.com/fmtlib/fmt/pull/1083>`_,
  2976. `#1113 <https://github.com/fmtlib/fmt/pull/1113>`_,
  2977. `#1114 <https://github.com/fmtlib/fmt/pull/1114>`_,
  2978. `#1146 <https://github.com/fmtlib/fmt/issues/1146>`_,
  2979. `#1180 <https://github.com/fmtlib/fmt/issues/1180>`_,
  2980. `#1250 <https://github.com/fmtlib/fmt/pull/1250>`_,
  2981. `#1252 <https://github.com/fmtlib/fmt/pull/1252>`_,
  2982. `#1265 <https://github.com/fmtlib/fmt/pull/1265>`_).
  2983. Thanks `@mikelui (Michael Lui) <https://github.com/mikelui>`_,
  2984. `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_,
  2985. `@BillyDonahue (Billy Donahue) <https://github.com/BillyDonahue>`_,
  2986. `@jwakely (Jonathan Wakely) <https://github.com/jwakely>`_,
  2987. `@kaisbe (Kais Ben Salah) <https://github.com/kaisbe>`_,
  2988. `@sdebionne (Samuel Debionne) <https://github.com/sdebionne>`_.
  2989. * Fixed ambiguous formatter specialization in ``fmt/ranges.h``
  2990. (`#1123 <https://github.com/fmtlib/fmt/issues/1123>`_).
  2991. * Fixed formatting of a non-empty ``std::filesystem::path`` which is an
  2992. infinitely deep range of its components
  2993. (`#1268 <https://github.com/fmtlib/fmt/issues/1268>`_).
  2994. * Fixed handling of general output iterators when formatting characters
  2995. (`#1056 <https://github.com/fmtlib/fmt/issues/1056>`_,
  2996. `#1058 <https://github.com/fmtlib/fmt/pull/1058>`_).
  2997. Thanks `@abolz (Alexander Bolz) <https://github.com/abolz>`_.
  2998. * Fixed handling of output iterators in ``formatter`` specialization for
  2999. ranges (`#1064 <https://github.com/fmtlib/fmt/issues/1064>`_).
  3000. * Fixed handling of exotic character types
  3001. (`#1188 <https://github.com/fmtlib/fmt/issues/1188>`_).
  3002. * Made chrono formatting work with exceptions disabled
  3003. (`#1062 <https://github.com/fmtlib/fmt/issues/1062>`_).
  3004. * Fixed DLL visibility issues
  3005. (`#1134 <https://github.com/fmtlib/fmt/pull/1134>`_,
  3006. `#1147 <https://github.com/fmtlib/fmt/pull/1147>`_).
  3007. Thanks `@denchat <https://github.com/denchat>`_.
  3008. * Disabled the use of UDL template extension on GCC 9
  3009. (`#1148 <https://github.com/fmtlib/fmt/issues/1148>`_).
  3010. * Removed misplaced ``format`` compile-time checks from ``printf``
  3011. (`#1173 <https://github.com/fmtlib/fmt/issues/1173>`_).
  3012. * Fixed issues in the experimental floating-point formatter
  3013. (`#1072 <https://github.com/fmtlib/fmt/issues/1072>`_,
  3014. `#1129 <https://github.com/fmtlib/fmt/issues/1129>`_,
  3015. `#1153 <https://github.com/fmtlib/fmt/issues/1153>`_,
  3016. `#1155 <https://github.com/fmtlib/fmt/pull/1155>`_,
  3017. `#1210 <https://github.com/fmtlib/fmt/issues/1210>`_,
  3018. `#1222 <https://github.com/fmtlib/fmt/issues/1222>`_).
  3019. Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
  3020. * Fixed bugs discovered by fuzzing or during fuzzing integration
  3021. (`#1124 <https://github.com/fmtlib/fmt/issues/1124>`_,
  3022. `#1127 <https://github.com/fmtlib/fmt/issues/1127>`_,
  3023. `#1132 <https://github.com/fmtlib/fmt/issues/1132>`_,
  3024. `#1135 <https://github.com/fmtlib/fmt/pull/1135>`_,
  3025. `#1136 <https://github.com/fmtlib/fmt/issues/1136>`_,
  3026. `#1141 <https://github.com/fmtlib/fmt/issues/1141>`_,
  3027. `#1142 <https://github.com/fmtlib/fmt/issues/1142>`_,
  3028. `#1178 <https://github.com/fmtlib/fmt/issues/1178>`_,
  3029. `#1179 <https://github.com/fmtlib/fmt/issues/1179>`_,
  3030. `#1194 <https://github.com/fmtlib/fmt/issues/1194>`_).
  3031. Thanks `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_.
  3032. * Fixed building tests on FreeBSD and Hurd
  3033. (`#1043 <https://github.com/fmtlib/fmt/issues/1043>`_).
  3034. Thanks `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
  3035. * Fixed various warnings and compilation issues
  3036. (`#998 <https://github.com/fmtlib/fmt/pull/998>`_,
  3037. `#1006 <https://github.com/fmtlib/fmt/pull/1006>`_,
  3038. `#1008 <https://github.com/fmtlib/fmt/issues/1008>`_,
  3039. `#1011 <https://github.com/fmtlib/fmt/issues/1011>`_,
  3040. `#1025 <https://github.com/fmtlib/fmt/issues/1025>`_,
  3041. `#1027 <https://github.com/fmtlib/fmt/pull/1027>`_,
  3042. `#1028 <https://github.com/fmtlib/fmt/pull/1028>`_,
  3043. `#1029 <https://github.com/fmtlib/fmt/pull/1029>`_,
  3044. `#1030 <https://github.com/fmtlib/fmt/pull/1030>`_,
  3045. `#1031 <https://github.com/fmtlib/fmt/pull/1031>`_,
  3046. `#1054 <https://github.com/fmtlib/fmt/pull/1054>`_,
  3047. `#1063 <https://github.com/fmtlib/fmt/issues/1063>`_,
  3048. `#1068 <https://github.com/fmtlib/fmt/pull/1068>`_,
  3049. `#1074 <https://github.com/fmtlib/fmt/pull/1074>`_,
  3050. `#1075 <https://github.com/fmtlib/fmt/pull/1075>`_,
  3051. `#1079 <https://github.com/fmtlib/fmt/pull/1079>`_,
  3052. `#1086 <https://github.com/fmtlib/fmt/pull/1086>`_,
  3053. `#1088 <https://github.com/fmtlib/fmt/issues/1088>`_,
  3054. `#1089 <https://github.com/fmtlib/fmt/pull/1089>`_,
  3055. `#1094 <https://github.com/fmtlib/fmt/pull/1094>`_,
  3056. `#1101 <https://github.com/fmtlib/fmt/issues/1101>`_,
  3057. `#1102 <https://github.com/fmtlib/fmt/pull/1102>`_,
  3058. `#1105 <https://github.com/fmtlib/fmt/issues/1105>`_,
  3059. `#1107 <https://github.com/fmtlib/fmt/pull/1107>`_,
  3060. `#1115 <https://github.com/fmtlib/fmt/issues/1115>`_,
  3061. `#1117 <https://github.com/fmtlib/fmt/issues/1117>`_,
  3062. `#1118 <https://github.com/fmtlib/fmt/issues/1118>`_,
  3063. `#1120 <https://github.com/fmtlib/fmt/issues/1120>`_,
  3064. `#1123 <https://github.com/fmtlib/fmt/issues/1123>`_,
  3065. `#1139 <https://github.com/fmtlib/fmt/pull/1139>`_,
  3066. `#1140 <https://github.com/fmtlib/fmt/issues/1140>`_,
  3067. `#1143 <https://github.com/fmtlib/fmt/issues/1143>`_,
  3068. `#1144 <https://github.com/fmtlib/fmt/pull/1144>`_,
  3069. `#1150 <https://github.com/fmtlib/fmt/pull/1150>`_,
  3070. `#1151 <https://github.com/fmtlib/fmt/pull/1151>`_,
  3071. `#1152 <https://github.com/fmtlib/fmt/issues/1152>`_,
  3072. `#1154 <https://github.com/fmtlib/fmt/issues/1154>`_,
  3073. `#1156 <https://github.com/fmtlib/fmt/issues/1156>`_,
  3074. `#1159 <https://github.com/fmtlib/fmt/pull/1159>`_,
  3075. `#1175 <https://github.com/fmtlib/fmt/issues/1175>`_,
  3076. `#1181 <https://github.com/fmtlib/fmt/issues/1181>`_,
  3077. `#1186 <https://github.com/fmtlib/fmt/issues/1186>`_,
  3078. `#1187 <https://github.com/fmtlib/fmt/pull/1187>`_,
  3079. `#1191 <https://github.com/fmtlib/fmt/pull/1191>`_,
  3080. `#1197 <https://github.com/fmtlib/fmt/issues/1197>`_,
  3081. `#1200 <https://github.com/fmtlib/fmt/issues/1200>`_,
  3082. `#1203 <https://github.com/fmtlib/fmt/issues/1203>`_,
  3083. `#1205 <https://github.com/fmtlib/fmt/issues/1205>`_,
  3084. `#1206 <https://github.com/fmtlib/fmt/pull/1206>`_,
  3085. `#1213 <https://github.com/fmtlib/fmt/issues/1213>`_,
  3086. `#1214 <https://github.com/fmtlib/fmt/issues/1214>`_,
  3087. `#1217 <https://github.com/fmtlib/fmt/pull/1217>`_,
  3088. `#1228 <https://github.com/fmtlib/fmt/issues/1228>`_,
  3089. `#1230 <https://github.com/fmtlib/fmt/pull/1230>`_,
  3090. `#1232 <https://github.com/fmtlib/fmt/issues/1232>`_,
  3091. `#1235 <https://github.com/fmtlib/fmt/pull/1235>`_,
  3092. `#1236 <https://github.com/fmtlib/fmt/pull/1236>`_,
  3093. `#1240 <https://github.com/fmtlib/fmt/issues/1240>`_).
  3094. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  3095. `@mwinterb <https://github.com/mwinterb>`_,
  3096. `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_,
  3097. `@morinmorin <https://github.com/morinmorin>`_,
  3098. `@ricco19 (Brian Ricciardelli) <https://github.com/ricco19>`_,
  3099. `@waywardmonkeys (Bruce Mitchener) <https://github.com/waywardmonkeys>`_,
  3100. `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_,
  3101. `@remyabel <https://github.com/remyabel>`_,
  3102. `@pauldreik (Paul Dreik) <https://github.com/pauldreik>`_,
  3103. `@gsjaardema (Greg Sjaardema) <https://github.com/gsjaardema>`_,
  3104. `@rcane (Ronny Krüger) <https://github.com/rcane>`_,
  3105. `@mocabe <https://github.com/mocabe>`_,
  3106. `@denchat <https://github.com/denchat>`_,
  3107. `@cjdb (Christopher Di Bella) <https://github.com/cjdb>`_,
  3108. `@HazardyKnusperkeks (Björn Schäpers) <https://github.com/HazardyKnusperkeks>`_,
  3109. `@vedranmiletic (Vedran Miletić) <https://github.com/vedranmiletic>`_,
  3110. `@jackoalan (Jack Andersen) <https://github.com/jackoalan>`_,
  3111. `@DaanDeMeyer (Daan De Meyer) <https://github.com/DaanDeMeyer>`_,
  3112. `@starkmapper (Mark Stapper) <https://github.com/starkmapper>`_.
  3113. 5.3.0 - 2018-12-28
  3114. ------------------
  3115. * Introduced experimental chrono formatting support:
  3116. .. code:: c++
  3117. #include <fmt/chrono.h>
  3118. int main() {
  3119. using namespace std::literals::chrono_literals;
  3120. fmt::print("Default format: {} {}\n", 42s, 100ms);
  3121. fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s);
  3122. }
  3123. prints::
  3124. Default format: 42s 100ms
  3125. strftime-like format: 03:15:30
  3126. * Added experimental support for emphasis (bold, italic, underline,
  3127. strikethrough), colored output to a file stream, and improved colored
  3128. formatting API
  3129. (`#961 <https://github.com/fmtlib/fmt/pull/961>`_,
  3130. `#967 <https://github.com/fmtlib/fmt/pull/967>`_,
  3131. `#973 <https://github.com/fmtlib/fmt/pull/973>`_):
  3132. .. code:: c++
  3133. #include <fmt/color.h>
  3134. int main() {
  3135. print(fg(fmt::color::crimson) | fmt::emphasis::bold,
  3136. "Hello, {}!\n", "world");
  3137. print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
  3138. fmt::emphasis::underline, "Hello, {}!\n", "мир");
  3139. print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
  3140. "Hello, {}!\n", "世界");
  3141. }
  3142. prints the following on modern terminals with RGB color support:
  3143. .. image:: https://user-images.githubusercontent.com/576385/
  3144. 50405788-b66e7500-076e-11e9-9592-7324d1f951d8.png
  3145. Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_.
  3146. * Added support for 4-bit terminal colors
  3147. (`#968 <https://github.com/fmtlib/fmt/issues/968>`_,
  3148. `#974 <https://github.com/fmtlib/fmt/pull/974>`_)
  3149. .. code:: c++
  3150. #include <fmt/color.h>
  3151. int main() {
  3152. print(fg(fmt::terminal_color::red), "stop\n");
  3153. }
  3154. Note that these colors vary by terminal:
  3155. .. image:: https://user-images.githubusercontent.com/576385/
  3156. 50405925-dbfc7e00-0770-11e9-9b85-333fab0af9ac.png
  3157. Thanks `@Rakete1111 (Nicolas) <https://github.com/Rakete1111>`_.
  3158. * Parameterized formatting functions on the type of the format string
  3159. (`#880 <https://github.com/fmtlib/fmt/issues/880>`_,
  3160. `#881 <https://github.com/fmtlib/fmt/pull/881>`_,
  3161. `#883 <https://github.com/fmtlib/fmt/pull/883>`_,
  3162. `#885 <https://github.com/fmtlib/fmt/pull/885>`_,
  3163. `#897 <https://github.com/fmtlib/fmt/pull/897>`_,
  3164. `#920 <https://github.com/fmtlib/fmt/issues/920>`_).
  3165. Any object of type ``S`` that has an overloaded ``to_string_view(const S&)``
  3166. returning ``fmt::string_view`` can be used as a format string:
  3167. .. code:: c++
  3168. namespace my_ns {
  3169. inline string_view to_string_view(const my_string& s) {
  3170. return {s.data(), s.length()};
  3171. }
  3172. }
  3173. std::string message = fmt::format(my_string("The answer is {}."), 42);
  3174. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3175. * Made ``std::string_view`` work as a format string
  3176. (`#898 <https://github.com/fmtlib/fmt/pull/898>`_):
  3177. .. code:: c++
  3178. auto message = fmt::format(std::string_view("The answer is {}."), 42);
  3179. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3180. * Added wide string support to compile-time format string checks
  3181. (`#924 <https://github.com/fmtlib/fmt/pull/924>`_):
  3182. .. code:: c++
  3183. print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier
  3184. Thanks `@XZiar <https://github.com/XZiar>`_.
  3185. * Made colored print functions work with wide strings
  3186. (`#867 <https://github.com/fmtlib/fmt/pull/867>`_):
  3187. .. code:: c++
  3188. #include <fmt/color.h>
  3189. int main() {
  3190. print(fg(fmt::color::red), L"{}\n", 42);
  3191. }
  3192. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3193. * Introduced experimental Unicode support
  3194. (`#628 <https://github.com/fmtlib/fmt/issues/628>`_,
  3195. `#891 <https://github.com/fmtlib/fmt/pull/891>`_):
  3196. .. code:: c++
  3197. using namespace fmt::literals;
  3198. auto s = fmt::format("{:*^5}"_u, "🤡"_u); // s == "**🤡**"_u
  3199. * Improved locale support:
  3200. .. code:: c++
  3201. #include <fmt/locale.h>
  3202. struct numpunct : std::numpunct<char> {
  3203. protected:
  3204. char do_thousands_sep() const override { return '~'; }
  3205. };
  3206. std::locale loc;
  3207. auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567);
  3208. // s == "1~234~567"
  3209. * Constrained formatting functions on proper iterator types
  3210. (`#921 <https://github.com/fmtlib/fmt/pull/921>`_).
  3211. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3212. * Added ``make_printf_args`` and ``make_wprintf_args`` functions
  3213. (`#934 <https://github.com/fmtlib/fmt/pull/934>`_).
  3214. Thanks `@tnovotny <https://github.com/tnovotny>`_.
  3215. * Deprecated ``fmt::visit``, ``parse_context``, and ``wparse_context``.
  3216. Use ``fmt::visit_format_arg``, ``format_parse_context``, and
  3217. ``wformat_parse_context`` instead.
  3218. * Removed undocumented ``basic_fixed_buffer`` which has been superseded by the
  3219. iterator-based API
  3220. (`#873 <https://github.com/fmtlib/fmt/issues/873>`_,
  3221. `#902 <https://github.com/fmtlib/fmt/pull/902>`_).
  3222. Thanks `@superfunc (hollywood programmer) <https://github.com/superfunc>`_.
  3223. * Disallowed repeated leading zeros in an argument ID:
  3224. .. code:: c++
  3225. fmt::print("{000}", 42); // error
  3226. * Reintroduced support for gcc 4.4.
  3227. * Fixed compilation on platforms with exotic ``double``
  3228. (`#878 <https://github.com/fmtlib/fmt/issues/878>`_).
  3229. * Improved documentation
  3230. (`#164 <https://github.com/fmtlib/fmt/issues/164>`_,
  3231. `#877 <https://github.com/fmtlib/fmt/issues/877>`_,
  3232. `#901 <https://github.com/fmtlib/fmt/pull/901>`_,
  3233. `#906 <https://github.com/fmtlib/fmt/pull/906>`_,
  3234. `#979 <https://github.com/fmtlib/fmt/pull/979>`_).
  3235. Thanks `@kookjr (Mathew Cucuzella) <https://github.com/kookjr>`_,
  3236. `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_,
  3237. `@HecticSerenity <https://github.com/HecticSerenity>`_.
  3238. * Added pkgconfig support which makes it easier to consume the library from
  3239. meson and other build systems
  3240. (`#916 <https://github.com/fmtlib/fmt/pull/916>`_).
  3241. Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_.
  3242. * Various build improvements
  3243. (`#909 <https://github.com/fmtlib/fmt/pull/909>`_,
  3244. `#926 <https://github.com/fmtlib/fmt/pull/926>`_,
  3245. `#937 <https://github.com/fmtlib/fmt/pull/937>`_,
  3246. `#953 <https://github.com/fmtlib/fmt/pull/953>`_,
  3247. `#959 <https://github.com/fmtlib/fmt/pull/959>`_).
  3248. Thanks `@tchaikov (Kefu Chai) <https://github.com/tchaikov>`_,
  3249. `@luncliff (Park DongHa) <https://github.com/luncliff>`_,
  3250. `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_,
  3251. `@hotwatermorning <https://github.com/hotwatermorning>`_,
  3252. `@Zefz (JohanJansen) <https://github.com/Zefz>`_.
  3253. * Improved ``string_view`` construction performance
  3254. (`#914 <https://github.com/fmtlib/fmt/pull/914>`_).
  3255. Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_.
  3256. * Fixed non-matching char types
  3257. (`#895 <https://github.com/fmtlib/fmt/pull/895>`_).
  3258. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3259. * Fixed ``format_to_n`` with ``std::back_insert_iterator``
  3260. (`#913 <https://github.com/fmtlib/fmt/pull/913>`_).
  3261. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3262. * Fixed locale-dependent formatting
  3263. (`#905 <https://github.com/fmtlib/fmt/issues/905>`_).
  3264. * Fixed various compiler warnings and errors
  3265. (`#882 <https://github.com/fmtlib/fmt/pull/882>`_,
  3266. `#886 <https://github.com/fmtlib/fmt/pull/886>`_,
  3267. `#933 <https://github.com/fmtlib/fmt/pull/933>`_,
  3268. `#941 <https://github.com/fmtlib/fmt/pull/941>`_,
  3269. `#931 <https://github.com/fmtlib/fmt/issues/931>`_,
  3270. `#943 <https://github.com/fmtlib/fmt/pull/943>`_,
  3271. `#954 <https://github.com/fmtlib/fmt/pull/954>`_,
  3272. `#956 <https://github.com/fmtlib/fmt/pull/956>`_,
  3273. `#962 <https://github.com/fmtlib/fmt/pull/962>`_,
  3274. `#965 <https://github.com/fmtlib/fmt/issues/965>`_,
  3275. `#977 <https://github.com/fmtlib/fmt/issues/977>`_,
  3276. `#983 <https://github.com/fmtlib/fmt/pull/983>`_,
  3277. `#989 <https://github.com/fmtlib/fmt/pull/989>`_).
  3278. Thanks `@Luthaf (Guillaume Fraux) <https://github.com/Luthaf>`_,
  3279. `@stevenhoving (Steven Hoving) <https://github.com/stevenhoving>`_,
  3280. `@christinaa (Kristina Brooks) <https://github.com/christinaa>`_,
  3281. `@lgritz (Larry Gritz) <https://github.com/lgritz>`_,
  3282. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  3283. `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_,
  3284. `@liuping1997 <https://github.com/liuping1997>`_.
  3285. 5.2.1 - 2018-09-21
  3286. ------------------
  3287. * Fixed ``visit`` lookup issues on gcc 7 & 8
  3288. (`#870 <https://github.com/fmtlib/fmt/pull/870>`_).
  3289. Thanks `@medithe <https://github.com/medithe>`_.
  3290. * Fixed linkage errors on older gcc.
  3291. * Prevented ``fmt/range.h`` from specializing ``fmt::basic_string_view``
  3292. (`#865 <https://github.com/fmtlib/fmt/issues/865>`_,
  3293. `#868 <https://github.com/fmtlib/fmt/pull/868>`_).
  3294. Thanks `@hhggit (dual) <https://github.com/hhggit>`_.
  3295. * Improved error message when formatting unknown types
  3296. (`#872 <https://github.com/fmtlib/fmt/pull/872>`_).
  3297. Thanks `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_,
  3298. * Disabled templated user-defined literals when compiled under nvcc
  3299. (`#875 <https://github.com/fmtlib/fmt/pull/875>`_).
  3300. Thanks `@CandyGumdrop (Candy Gumdrop) <https://github.com/CandyGumdrop>`_,
  3301. * Fixed ``format_to`` formatting to ``wmemory_buffer``
  3302. (`#874 <https://github.com/fmtlib/fmt/issues/874>`_).
  3303. 5.2.0 - 2018-09-13
  3304. ------------------
  3305. * Optimized format string parsing and argument processing which resulted in up
  3306. to 5x speed up on long format strings and significant performance boost on
  3307. various benchmarks. For example, version 5.2 is 2.22x faster than 5.1 on
  3308. decimal integer formatting with ``format_to`` (macOS, clang-902.0.39.2):
  3309. ================== ======= =======
  3310. Method Time, s Speedup
  3311. ================== ======= =======
  3312. fmt::format 5.1 0.58
  3313. fmt::format 5.2 0.35 1.66x
  3314. fmt::format_to 5.1 0.51
  3315. fmt::format_to 5.2 0.23 2.22x
  3316. sprintf 0.71
  3317. std::to_string 1.01
  3318. std::stringstream 1.73
  3319. ================== ======= =======
  3320. * Changed the ``fmt`` macro from opt-out to opt-in to prevent name collisions.
  3321. To enable it define the ``FMT_STRING_ALIAS`` macro to 1 before including
  3322. ``fmt/format.h``:
  3323. .. code:: c++
  3324. #define FMT_STRING_ALIAS 1
  3325. #include <fmt/format.h>
  3326. std::string answer = format(fmt("{}"), 42);
  3327. * Added compile-time format string checks to ``format_to`` overload that takes
  3328. ``fmt::memory_buffer`` (`#783 <https://github.com/fmtlib/fmt/issues/783>`_):
  3329. .. code:: c++
  3330. fmt::memory_buffer buf;
  3331. // Compile-time error: invalid type specifier.
  3332. fmt::format_to(buf, fmt("{:d}"), "foo");
  3333. * Moved experimental color support to ``fmt/color.h`` and enabled the
  3334. new API by default. The old API can be enabled by defining the
  3335. ``FMT_DEPRECATED_COLORS`` macro.
  3336. * Added formatting support for types explicitly convertible to
  3337. ``fmt::string_view``:
  3338. .. code:: c++
  3339. struct foo {
  3340. explicit operator fmt::string_view() const { return "foo"; }
  3341. };
  3342. auto s = format("{}", foo());
  3343. In particular, this makes formatting function work with
  3344. ``folly::StringPiece``.
  3345. * Implemented preliminary support for ``char*_t`` by replacing the ``format``
  3346. function overloads with a single function template parameterized on the string
  3347. type.
  3348. * Added support for dynamic argument lists
  3349. (`#814 <https://github.com/fmtlib/fmt/issues/814>`_,
  3350. `#819 <https://github.com/fmtlib/fmt/pull/819>`_).
  3351. Thanks `@MikePopoloski (Michael Popoloski)
  3352. <https://github.com/MikePopoloski>`_.
  3353. * Reduced executable size overhead for embedded targets using newlib nano by
  3354. making locale dependency optional
  3355. (`#839 <https://github.com/fmtlib/fmt/pull/839>`_).
  3356. Thanks `@teajay-fr (Thomas Benard) <https://github.com/teajay-fr>`_.
  3357. * Keep ``noexcept`` specifier when exceptions are disabled
  3358. (`#801 <https://github.com/fmtlib/fmt/issues/801>`_,
  3359. `#810 <https://github.com/fmtlib/fmt/pull/810>`_).
  3360. Thanks `@qis (Alexej Harm) <https://github.com/qis>`_.
  3361. * Fixed formatting of user-defined types providing ``operator<<`` with
  3362. ``format_to_n``
  3363. (`#806 <https://github.com/fmtlib/fmt/pull/806>`_).
  3364. Thanks `@mkurdej (Marek Kurdej) <https://github.com/mkurdej>`_.
  3365. * Fixed dynamic linkage of new symbols
  3366. (`#808 <https://github.com/fmtlib/fmt/issues/808>`_).
  3367. * Fixed global initialization issue
  3368. (`#807 <https://github.com/fmtlib/fmt/issues/807>`_):
  3369. .. code:: c++
  3370. // This works on compilers with constexpr support.
  3371. static const std::string answer = fmt::format("{}", 42);
  3372. * Fixed various compiler warnings and errors
  3373. (`#804 <https://github.com/fmtlib/fmt/pull/804>`_,
  3374. `#809 <https://github.com/fmtlib/fmt/issues/809>`_,
  3375. `#811 <https://github.com/fmtlib/fmt/pull/811>`_,
  3376. `#822 <https://github.com/fmtlib/fmt/issues/822>`_,
  3377. `#827 <https://github.com/fmtlib/fmt/pull/827>`_,
  3378. `#830 <https://github.com/fmtlib/fmt/issues/830>`_,
  3379. `#838 <https://github.com/fmtlib/fmt/pull/838>`_,
  3380. `#843 <https://github.com/fmtlib/fmt/issues/843>`_,
  3381. `#844 <https://github.com/fmtlib/fmt/pull/844>`_,
  3382. `#851 <https://github.com/fmtlib/fmt/issues/851>`_,
  3383. `#852 <https://github.com/fmtlib/fmt/pull/852>`_,
  3384. `#854 <https://github.com/fmtlib/fmt/pull/854>`_).
  3385. Thanks `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_,
  3386. `@medithe <https://github.com/medithe>`_, and
  3387. `@eliasdaler (Elias Daler) <https://github.com/eliasdaler>`_.
  3388. 5.1.0 - 2018-07-05
  3389. ------------------
  3390. * Added experimental support for RGB color output enabled with
  3391. the ``FMT_EXTENDED_COLORS`` macro:
  3392. .. code:: c++
  3393. #define FMT_EXTENDED_COLORS
  3394. #define FMT_HEADER_ONLY // or compile fmt with FMT_EXTENDED_COLORS defined
  3395. #include <fmt/format.h>
  3396. fmt::print(fmt::color::steel_blue, "Some beautiful text");
  3397. The old API (the ``print_colored`` and ``vprint_colored`` functions and the
  3398. ``color`` enum) is now deprecated.
  3399. (`#762 <https://github.com/fmtlib/fmt/issues/762>`_
  3400. `#767 <https://github.com/fmtlib/fmt/pull/767>`_).
  3401. thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
  3402. * Added quotes to strings in ranges and tuples
  3403. (`#766 <https://github.com/fmtlib/fmt/pull/766>`_).
  3404. Thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
  3405. * Made ``format_to`` work with ``basic_memory_buffer``
  3406. (`#776 <https://github.com/fmtlib/fmt/issues/776>`_).
  3407. * Added ``vformat_to_n`` and ``wchar_t`` overload of ``format_to_n``
  3408. (`#764 <https://github.com/fmtlib/fmt/issues/764>`_,
  3409. `#769 <https://github.com/fmtlib/fmt/issues/769>`_).
  3410. * Made ``is_range`` and ``is_tuple_like`` part of public (experimental) API
  3411. to allow specialization for user-defined types
  3412. (`#751 <https://github.com/fmtlib/fmt/issues/751>`_,
  3413. `#759 <https://github.com/fmtlib/fmt/pull/759>`_).
  3414. Thanks `@drrlvn (Dror Levin) <https://github.com/drrlvn>`_.
  3415. * Added more compilers to continuous integration and increased ``FMT_PEDANTIC``
  3416. warning levels
  3417. (`#736 <https://github.com/fmtlib/fmt/pull/736>`_).
  3418. Thanks `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_.
  3419. * Fixed compilation with MSVC 2013.
  3420. * Fixed handling of user-defined types in ``format_to``
  3421. (`#793 <https://github.com/fmtlib/fmt/issues/793>`_).
  3422. * Forced linking of inline ``vformat`` functions into the library
  3423. (`#795 <https://github.com/fmtlib/fmt/issues/795>`_).
  3424. * Fixed incorrect call to on_align in ``'{:}='``
  3425. (`#750 <https://github.com/fmtlib/fmt/issues/750>`_).
  3426. * Fixed floating-point formatting to a non-back_insert_iterator with sign &
  3427. numeric alignment specified
  3428. (`#756 <https://github.com/fmtlib/fmt/issues/756>`_).
  3429. * Fixed formatting to an array with ``format_to_n``
  3430. (`#778 <https://github.com/fmtlib/fmt/issues/778>`_).
  3431. * Fixed formatting of more than 15 named arguments
  3432. (`#754 <https://github.com/fmtlib/fmt/issues/754>`_).
  3433. * Fixed handling of compile-time strings when including ``fmt/ostream.h``.
  3434. (`#768 <https://github.com/fmtlib/fmt/issues/768>`_).
  3435. * Fixed various compiler warnings and errors
  3436. (`#742 <https://github.com/fmtlib/fmt/issues/742>`_,
  3437. `#748 <https://github.com/fmtlib/fmt/issues/748>`_,
  3438. `#752 <https://github.com/fmtlib/fmt/issues/752>`_,
  3439. `#770 <https://github.com/fmtlib/fmt/issues/770>`_,
  3440. `#775 <https://github.com/fmtlib/fmt/pull/775>`_,
  3441. `#779 <https://github.com/fmtlib/fmt/issues/779>`_,
  3442. `#780 <https://github.com/fmtlib/fmt/pull/780>`_,
  3443. `#790 <https://github.com/fmtlib/fmt/pull/790>`_,
  3444. `#792 <https://github.com/fmtlib/fmt/pull/792>`_,
  3445. `#800 <https://github.com/fmtlib/fmt/pull/800>`_).
  3446. Thanks `@Remotion (Remo) <https://github.com/Remotion>`_,
  3447. `@gabime (Gabi Melman) <https://github.com/gabime>`_,
  3448. `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_,
  3449. `@Dark-Passenger (Dhruv Paranjape) <https://github.com/Dark-Passenger>`_, and
  3450. `@0x8000-0000 (Sign Bit) <https://github.com/0x8000-0000>`_.
  3451. 5.0.0 - 2018-05-21
  3452. ------------------
  3453. * Added a requirement for partial C++11 support, most importantly variadic
  3454. templates and type traits, and dropped ``FMT_VARIADIC_*`` emulation macros.
  3455. Variadic templates are available since GCC 4.4, Clang 2.9 and MSVC 18.0 (2013).
  3456. For older compilers use {fmt} `version 4.x
  3457. <https://github.com/fmtlib/fmt/releases/tag/4.1.0>`_ which continues to be
  3458. maintained and works with C++98 compilers.
  3459. * Renamed symbols to follow standard C++ naming conventions and proposed a subset
  3460. of the library for standardization in `P0645R2 Text Formatting
  3461. <https://wg21.link/P0645>`_.
  3462. * Implemented ``constexpr`` parsing of format strings and `compile-time format
  3463. string checks
  3464. <https://fmt.dev/latest/api.html#compile-time-format-string-checks>`_. For
  3465. example
  3466. .. code:: c++
  3467. #include <fmt/format.h>
  3468. std::string s = format(fmt("{:d}"), "foo");
  3469. gives a compile-time error because ``d`` is an invalid specifier for strings
  3470. (`godbolt <https://godbolt.org/g/rnCy9Q>`__)::
  3471. ...
  3472. <source>:4:19: note: in instantiation of function template specialization 'fmt::v5::format<S, char [4]>' requested here
  3473. std::string s = format(fmt("{:d}"), "foo");
  3474. ^
  3475. format.h:1337:13: note: non-constexpr function 'on_error' cannot be used in a constant expression
  3476. handler.on_error("invalid type specifier");
  3477. Compile-time checks require relaxed ``constexpr`` (C++14 feature) support. If
  3478. the latter is not available, checks will be performed at runtime.
  3479. * Separated format string parsing and formatting in the extension API to enable
  3480. compile-time format string processing. For example
  3481. .. code:: c++
  3482. struct Answer {};
  3483. namespace fmt {
  3484. template <>
  3485. struct formatter<Answer> {
  3486. constexpr auto parse(parse_context& ctx) {
  3487. auto it = ctx.begin();
  3488. spec = *it;
  3489. if (spec != 'd' && spec != 's')
  3490. throw format_error("invalid specifier");
  3491. return ++it;
  3492. }
  3493. template <typename FormatContext>
  3494. auto format(Answer, FormatContext& ctx) {
  3495. return spec == 's' ?
  3496. format_to(ctx.begin(), "{}", "fourty-two") :
  3497. format_to(ctx.begin(), "{}", 42);
  3498. }
  3499. char spec = 0;
  3500. };
  3501. }
  3502. std::string s = format(fmt("{:x}"), Answer());
  3503. gives a compile-time error due to invalid format specifier (`godbolt
  3504. <https://godbolt.org/g/2jQ1Dv>`__)::
  3505. ...
  3506. <source>:12:45: error: expression '<throw-expression>' is not a constant expression
  3507. throw format_error("invalid specifier");
  3508. * Added `iterator support
  3509. <https://fmt.dev/latest/api.html#output-iterator-support>`_:
  3510. .. code:: c++
  3511. #include <vector>
  3512. #include <fmt/format.h>
  3513. std::vector<char> out;
  3514. fmt::format_to(std::back_inserter(out), "{}", 42);
  3515. * Added the `format_to_n
  3516. <https://fmt.dev/latest/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_
  3517. function that restricts the output to the specified number of characters
  3518. (`#298 <https://github.com/fmtlib/fmt/issues/298>`_):
  3519. .. code:: c++
  3520. char out[4];
  3521. fmt::format_to_n(out, sizeof(out), "{}", 12345);
  3522. // out == "1234" (without terminating '\0')
  3523. * Added the `formatted_size
  3524. <https://fmt.dev/latest/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_
  3525. function for computing the output size:
  3526. .. code:: c++
  3527. #include <fmt/format.h>
  3528. auto size = fmt::formatted_size("{}", 12345); // size == 5
  3529. * Improved compile times by reducing dependencies on standard headers and
  3530. providing a lightweight `core API <https://fmt.dev/latest/api.html#core-api>`_:
  3531. .. code:: c++
  3532. #include <fmt/core.h>
  3533. fmt::print("The answer is {}.", 42);
  3534. See `Compile time and code bloat
  3535. <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_.
  3536. * Added the `make_format_args
  3537. <https://fmt.dev/latest/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_
  3538. function for capturing formatting arguments:
  3539. .. code:: c++
  3540. // Prints formatted error message.
  3541. void vreport_error(const char *format, fmt::format_args args) {
  3542. fmt::print("Error: ");
  3543. fmt::vprint(format, args);
  3544. }
  3545. template <typename... Args>
  3546. void report_error(const char *format, const Args & ... args) {
  3547. vreport_error(format, fmt::make_format_args(args...));
  3548. }
  3549. * Added the ``make_printf_args`` function for capturing ``printf`` arguments
  3550. (`#687 <https://github.com/fmtlib/fmt/issues/687>`_,
  3551. `#694 <https://github.com/fmtlib/fmt/pull/694>`_).
  3552. Thanks `@Kronuz (Germán Méndez Bravo) <https://github.com/Kronuz>`_.
  3553. * Added prefix ``v`` to non-variadic functions taking ``format_args`` to
  3554. distinguish them from variadic ones:
  3555. .. code:: c++
  3556. std::string vformat(string_view format_str, format_args args);
  3557. template <typename... Args>
  3558. std::string format(string_view format_str, const Args & ... args);
  3559. * Added experimental support for formatting ranges, containers and tuple-like
  3560. types in ``fmt/ranges.h`` (`#735 <https://github.com/fmtlib/fmt/pull/735>`_):
  3561. .. code:: c++
  3562. #include <fmt/ranges.h>
  3563. std::vector<int> v = {1, 2, 3};
  3564. fmt::print("{}", v); // prints {1, 2, 3}
  3565. Thanks `@Remotion (Remo) <https://github.com/Remotion>`_.
  3566. * Implemented ``wchar_t`` date and time formatting
  3567. (`#712 <https://github.com/fmtlib/fmt/pull/712>`_):
  3568. .. code:: c++
  3569. #include <fmt/time.h>
  3570. std::time_t t = std::time(nullptr);
  3571. auto s = fmt::format(L"The date is {:%Y-%m-%d}.", *std::localtime(&t));
  3572. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3573. * Provided more wide string overloads
  3574. (`#724 <https://github.com/fmtlib/fmt/pull/724>`_).
  3575. Thanks `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_.
  3576. * Switched from a custom null-terminated string view class to ``string_view``
  3577. in the format API and provided ``fmt::string_view`` which implements a subset
  3578. of ``std::string_view`` API for pre-C++17 systems.
  3579. * Added support for ``std::experimental::string_view``
  3580. (`#607 <https://github.com/fmtlib/fmt/pull/607>`_):
  3581. .. code:: c++
  3582. #include <fmt/core.h>
  3583. #include <experimental/string_view>
  3584. fmt::print("{}", std::experimental::string_view("foo"));
  3585. Thanks `@virgiliofornazin (Virgilio Alexandre Fornazin)
  3586. <https://github.com/virgiliofornazin>`__.
  3587. * Allowed mixing named and automatic arguments:
  3588. .. code:: c++
  3589. fmt::format("{} {two}", 1, fmt::arg("two", 2));
  3590. * Removed the write API in favor of the `format API
  3591. <https://fmt.dev/latest/api.html#format-api>`_ with compile-time handling of
  3592. format strings.
  3593. * Disallowed formatting of multibyte strings into a wide character target
  3594. (`#606 <https://github.com/fmtlib/fmt/pull/606>`_).
  3595. * Improved documentation
  3596. (`#515 <https://github.com/fmtlib/fmt/pull/515>`_,
  3597. `#614 <https://github.com/fmtlib/fmt/issues/614>`_,
  3598. `#617 <https://github.com/fmtlib/fmt/pull/617>`_,
  3599. `#661 <https://github.com/fmtlib/fmt/pull/661>`_,
  3600. `#680 <https://github.com/fmtlib/fmt/pull/680>`_).
  3601. Thanks `@ibell (Ian Bell) <https://github.com/ibell>`_,
  3602. `@mihaitodor (Mihai Todor) <https://github.com/mihaitodor>`_, and
  3603. `@johnthagen <https://github.com/johnthagen>`_.
  3604. * Implemented more efficient handling of large number of format arguments.
  3605. * Introduced an inline namespace for symbol versioning.
  3606. * Added debug postfix ``d`` to the ``fmt`` library name
  3607. (`#636 <https://github.com/fmtlib/fmt/issues/636>`_).
  3608. * Removed unnecessary ``fmt/`` prefix in includes
  3609. (`#397 <https://github.com/fmtlib/fmt/pull/397>`_).
  3610. Thanks `@chronoxor (Ivan Shynkarenka) <https://github.com/chronoxor>`_.
  3611. * Moved ``fmt/*.h`` to ``include/fmt/*.h`` to prevent irrelevant files and
  3612. directories appearing on the include search paths when fmt is used as a
  3613. subproject and moved source files to the ``src`` directory.
  3614. * Added qmake project file ``support/fmt.pro``
  3615. (`#641 <https://github.com/fmtlib/fmt/pull/641>`_).
  3616. Thanks `@cowo78 (Giuseppe Corbelli) <https://github.com/cowo78>`_.
  3617. * Added Gradle build file ``support/build.gradle``
  3618. (`#649 <https://github.com/fmtlib/fmt/pull/649>`_).
  3619. Thanks `@luncliff (Park DongHa) <https://github.com/luncliff>`_.
  3620. * Removed ``FMT_CPPFORMAT`` CMake option.
  3621. * Fixed a name conflict with the macro ``CHAR_WIDTH`` in glibc
  3622. (`#616 <https://github.com/fmtlib/fmt/pull/616>`_).
  3623. Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_.
  3624. * Fixed handling of nested braces in ``fmt::join``
  3625. (`#638 <https://github.com/fmtlib/fmt/issues/638>`_).
  3626. * Added ``SOURCELINK_SUFFIX`` for compatibility with Sphinx 1.5
  3627. (`#497 <https://github.com/fmtlib/fmt/pull/497>`_).
  3628. Thanks `@ginggs (Graham Inggs) <https://github.com/ginggs>`_.
  3629. * Added a missing ``inline`` in the header-only mode
  3630. (`#626 <https://github.com/fmtlib/fmt/pull/626>`_).
  3631. Thanks `@aroig (Abdó Roig-Maranges) <https://github.com/aroig>`_.
  3632. * Fixed various compiler warnings
  3633. (`#640 <https://github.com/fmtlib/fmt/pull/640>`_,
  3634. `#656 <https://github.com/fmtlib/fmt/pull/656>`_,
  3635. `#679 <https://github.com/fmtlib/fmt/pull/679>`_,
  3636. `#681 <https://github.com/fmtlib/fmt/pull/681>`_,
  3637. `#705 <https://github.com/fmtlib/fmt/pull/705>`__,
  3638. `#715 <https://github.com/fmtlib/fmt/issues/715>`_,
  3639. `#717 <https://github.com/fmtlib/fmt/pull/717>`_,
  3640. `#720 <https://github.com/fmtlib/fmt/pull/720>`_,
  3641. `#723 <https://github.com/fmtlib/fmt/pull/723>`_,
  3642. `#726 <https://github.com/fmtlib/fmt/pull/726>`_,
  3643. `#730 <https://github.com/fmtlib/fmt/pull/730>`_,
  3644. `#739 <https://github.com/fmtlib/fmt/pull/739>`_).
  3645. Thanks `@peterbell10 <https://github.com/peterbell10>`_,
  3646. `@LarsGullik <https://github.com/LarsGullik>`_,
  3647. `@foonathan (Jonathan Müller) <https://github.com/foonathan>`_,
  3648. `@eliaskosunen (Elias Kosunen) <https://github.com/eliaskosunen>`_,
  3649. `@christianparpart (Christian Parpart) <https://github.com/christianparpart>`_,
  3650. `@DanielaE (Daniela Engert) <https://github.com/DanielaE>`_,
  3651. and `@mwinterb <https://github.com/mwinterb>`_.
  3652. * Worked around an MSVC bug and fixed several warnings
  3653. (`#653 <https://github.com/fmtlib/fmt/pull/653>`_).
  3654. Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
  3655. * Worked around GCC bug 67371
  3656. (`#682 <https://github.com/fmtlib/fmt/issues/682>`_).
  3657. * Fixed compilation with ``-fno-exceptions``
  3658. (`#655 <https://github.com/fmtlib/fmt/pull/655>`_).
  3659. Thanks `@chenxiaolong (Andrew Gunnerson) <https://github.com/chenxiaolong>`_.
  3660. * Made ``constexpr remove_prefix`` gcc version check tighter
  3661. (`#648 <https://github.com/fmtlib/fmt/issues/648>`_).
  3662. * Renamed internal type enum constants to prevent collision with poorly written
  3663. C libraries (`#644 <https://github.com/fmtlib/fmt/issues/644>`_).
  3664. * Added detection of ``wostream operator<<``
  3665. (`#650 <https://github.com/fmtlib/fmt/issues/650>`_).
  3666. * Fixed compilation on OpenBSD
  3667. (`#660 <https://github.com/fmtlib/fmt/pull/660>`_).
  3668. Thanks `@hubslave <https://github.com/hubslave>`_.
  3669. * Fixed compilation on FreeBSD 12
  3670. (`#732 <https://github.com/fmtlib/fmt/pull/732>`_).
  3671. Thanks `@dankm <https://github.com/dankm>`_.
  3672. * Fixed compilation when there is a mismatch between ``-std`` options between
  3673. the library and user code
  3674. (`#664 <https://github.com/fmtlib/fmt/issues/664>`_).
  3675. * Fixed compilation with GCC 7 and ``-std=c++11``
  3676. (`#734 <https://github.com/fmtlib/fmt/issues/734>`_).
  3677. * Improved generated binary code on GCC 7 and older
  3678. (`#668 <https://github.com/fmtlib/fmt/issues/668>`_).
  3679. * Fixed handling of numeric alignment with no width
  3680. (`#675 <https://github.com/fmtlib/fmt/issues/675>`_).
  3681. * Fixed handling of empty strings in UTF8/16 converters
  3682. (`#676 <https://github.com/fmtlib/fmt/pull/676>`_).
  3683. Thanks `@vgalka-sl (Vasili Galka) <https://github.com/vgalka-sl>`_.
  3684. * Fixed formatting of an empty ``string_view``
  3685. (`#689 <https://github.com/fmtlib/fmt/issues/689>`_).
  3686. * Fixed detection of ``string_view`` on libc++
  3687. (`#686 <https://github.com/fmtlib/fmt/issues/686>`_).
  3688. * Fixed DLL issues (`#696 <https://github.com/fmtlib/fmt/pull/696>`_).
  3689. Thanks `@sebkoenig <https://github.com/sebkoenig>`_.
  3690. * Fixed compile checks for mixing narrow and wide strings
  3691. (`#690 <https://github.com/fmtlib/fmt/issues/690>`_).
  3692. * Disabled unsafe implicit conversion to ``std::string``
  3693. (`#729 <https://github.com/fmtlib/fmt/issues/729>`_).
  3694. * Fixed handling of reused format specs (as in ``fmt::join``) for pointers
  3695. (`#725 <https://github.com/fmtlib/fmt/pull/725>`_).
  3696. Thanks `@mwinterb <https://github.com/mwinterb>`_.
  3697. * Fixed installation of ``fmt/ranges.h``
  3698. (`#738 <https://github.com/fmtlib/fmt/pull/738>`_).
  3699. Thanks `@sv1990 <https://github.com/sv1990>`_.
  3700. 4.1.0 - 2017-12-20
  3701. ------------------
  3702. * Added ``fmt::to_wstring()`` in addition to ``fmt::to_string()``
  3703. (`#559 <https://github.com/fmtlib/fmt/pull/559>`_).
  3704. Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
  3705. * Added support for C++17 ``std::string_view``
  3706. (`#571 <https://github.com/fmtlib/fmt/pull/571>`_ and
  3707. `#578 <https://github.com/fmtlib/fmt/pull/578>`_).
  3708. Thanks `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_ and
  3709. `@mwinterb <https://github.com/mwinterb>`_.
  3710. * Enabled stream exceptions to catch errors
  3711. (`#581 <https://github.com/fmtlib/fmt/issues/581>`_).
  3712. Thanks `@crusader-mike <https://github.com/crusader-mike>`_.
  3713. * Allowed formatting of class hierarchies with ``fmt::format_arg()``
  3714. (`#547 <https://github.com/fmtlib/fmt/pull/547>`_).
  3715. Thanks `@rollbear (Björn Fahller) <https://github.com/rollbear>`_.
  3716. * Removed limitations on character types
  3717. (`#563 <https://github.com/fmtlib/fmt/pull/563>`_).
  3718. Thanks `@Yelnats321 (Elnar Dakeshov) <https://github.com/Yelnats321>`_.
  3719. * Conditionally enabled use of ``std::allocator_traits``
  3720. (`#583 <https://github.com/fmtlib/fmt/pull/583>`_).
  3721. Thanks `@mwinterb <https://github.com/mwinterb>`_.
  3722. * Added support for ``const`` variadic member function emulation with
  3723. ``FMT_VARIADIC_CONST`` (`#591 <https://github.com/fmtlib/fmt/pull/591>`_).
  3724. Thanks `@ludekvodicka (Ludek Vodicka) <https://github.com/ludekvodicka>`_.
  3725. * Various bugfixes: bad overflow check, unsupported implicit type conversion
  3726. when determining formatting function, test segfaults
  3727. (`#551 <https://github.com/fmtlib/fmt/issues/551>`_), ill-formed macros
  3728. (`#542 <https://github.com/fmtlib/fmt/pull/542>`_) and ambiguous overloads
  3729. (`#580 <https://github.com/fmtlib/fmt/issues/580>`_).
  3730. Thanks `@xylosper (Byoung-young Lee) <https://github.com/xylosper>`_.
  3731. * Prevented warnings on MSVC (`#605 <https://github.com/fmtlib/fmt/pull/605>`_,
  3732. `#602 <https://github.com/fmtlib/fmt/pull/602>`_, and
  3733. `#545 <https://github.com/fmtlib/fmt/pull/545>`_),
  3734. clang (`#582 <https://github.com/fmtlib/fmt/pull/582>`_),
  3735. GCC (`#573 <https://github.com/fmtlib/fmt/issues/573>`_),
  3736. various conversion warnings (`#609 <https://github.com/fmtlib/fmt/pull/609>`_,
  3737. `#567 <https://github.com/fmtlib/fmt/pull/567>`_,
  3738. `#553 <https://github.com/fmtlib/fmt/pull/553>`_ and
  3739. `#553 <https://github.com/fmtlib/fmt/pull/553>`_), and added ``override`` and
  3740. ``[[noreturn]]`` (`#549 <https://github.com/fmtlib/fmt/pull/549>`_ and
  3741. `#555 <https://github.com/fmtlib/fmt/issues/555>`_).
  3742. Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_,
  3743. `@virgiliofornazin (Virgilio Alexandre Fornazin)
  3744. <https://gihtub.com/virgiliofornazin>`_,
  3745. `@alexanderbock (Alexander Bock) <https://github.com/alexanderbock>`_,
  3746. `@yumetodo <https://github.com/yumetodo>`_,
  3747. `@VaderY (Császár Mátyás) <https://github.com/VaderY>`_,
  3748. `@jpcima (JP Cimalando) <https://github.com/jpcima>`_,
  3749. `@thelostt (Mário Feroldi) <https://github.com/thelostt>`_, and
  3750. `@Manu343726 (Manu Sánchez) <https://github.com/Manu343726>`_.
  3751. * Improved CMake: Used ``GNUInstallDirs`` to set installation location
  3752. (`#610 <https://github.com/fmtlib/fmt/pull/610>`_) and fixed warnings
  3753. (`#536 <https://github.com/fmtlib/fmt/pull/536>`_ and
  3754. `#556 <https://github.com/fmtlib/fmt/pull/556>`_).
  3755. Thanks `@mikecrowe (Mike Crowe) <https://github.com/mikecrowe>`_,
  3756. `@evgen231 <https://github.com/evgen231>`_ and
  3757. `@henryiii (Henry Schreiner) <https://github.com/henryiii>`_.
  3758. 4.0.0 - 2017-06-27
  3759. ------------------
  3760. * Removed old compatibility headers ``cppformat/*.h`` and CMake options
  3761. (`#527 <https://github.com/fmtlib/fmt/pull/527>`_).
  3762. Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
  3763. * Added ``string.h`` containing ``fmt::to_string()`` as alternative to
  3764. ``std::to_string()`` as well as other string writer functionality
  3765. (`#326 <https://github.com/fmtlib/fmt/issues/326>`_ and
  3766. `#441 <https://github.com/fmtlib/fmt/pull/441>`_):
  3767. .. code:: c++
  3768. #include "fmt/string.h"
  3769. std::string answer = fmt::to_string(42);
  3770. Thanks to `@glebov-andrey (Andrey Glebov)
  3771. <https://github.com/glebov-andrey>`_.
  3772. * Moved ``fmt::printf()`` to new ``printf.h`` header and allowed ``%s`` as
  3773. generic specifier (`#453 <https://github.com/fmtlib/fmt/pull/453>`_),
  3774. made ``%.f`` more conformant to regular ``printf()``
  3775. (`#490 <https://github.com/fmtlib/fmt/pull/490>`_), added custom writer
  3776. support (`#476 <https://github.com/fmtlib/fmt/issues/476>`_) and implemented
  3777. missing custom argument formatting
  3778. (`#339 <https://github.com/fmtlib/fmt/pull/339>`_ and
  3779. `#340 <https://github.com/fmtlib/fmt/pull/340>`_):
  3780. .. code:: c++
  3781. #include "fmt/printf.h"
  3782. // %s format specifier can be used with any argument type.
  3783. fmt::printf("%s", 42);
  3784. Thanks `@mojoBrendan <https://github.com/mojoBrendan>`_,
  3785. `@manylegged (Arthur Danskin) <https://github.com/manylegged>`_ and
  3786. `@spacemoose (Glen Stark) <https://github.com/spacemoose>`_.
  3787. See also `#360 <https://github.com/fmtlib/fmt/issues/360>`_,
  3788. `#335 <https://github.com/fmtlib/fmt/issues/335>`_ and
  3789. `#331 <https://github.com/fmtlib/fmt/issues/331>`_.
  3790. * Added ``container.h`` containing a ``BasicContainerWriter``
  3791. to write to containers like ``std::vector``
  3792. (`#450 <https://github.com/fmtlib/fmt/pull/450>`_).
  3793. Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
  3794. * Added ``fmt::join()`` function that takes a range and formats
  3795. its elements separated by a given string
  3796. (`#466 <https://github.com/fmtlib/fmt/pull/466>`_):
  3797. .. code:: c++
  3798. #include "fmt/format.h"
  3799. std::vector<double> v = {1.2, 3.4, 5.6};
  3800. // Prints "(+01.20, +03.40, +05.60)".
  3801. fmt::print("({:+06.2f})", fmt::join(v.begin(), v.end(), ", "));
  3802. Thanks `@olivier80 <https://github.com/olivier80>`_.
  3803. * Added support for custom formatting specifications to simplify customization
  3804. of built-in formatting (`#444 <https://github.com/fmtlib/fmt/pull/444>`_).
  3805. Thanks `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
  3806. See also `#439 <https://github.com/fmtlib/fmt/issues/439>`_.
  3807. * Added ``fmt::format_system_error()`` for error code formatting
  3808. (`#323 <https://github.com/fmtlib/fmt/issues/323>`_ and
  3809. `#526 <https://github.com/fmtlib/fmt/pull/526>`_).
  3810. Thanks `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
  3811. * Added thread-safe ``fmt::localtime()`` and ``fmt::gmtime()``
  3812. as replacement for the standard version to ``time.h``
  3813. (`#396 <https://github.com/fmtlib/fmt/pull/396>`_).
  3814. Thanks `@codicodi <https://github.com/codicodi>`_.
  3815. * Internal improvements to ``NamedArg`` and ``ArgLists``
  3816. (`#389 <https://github.com/fmtlib/fmt/pull/389>`_ and
  3817. `#390 <https://github.com/fmtlib/fmt/pull/390>`_).
  3818. Thanks `@chronoxor <https://github.com/chronoxor>`_.
  3819. * Fixed crash due to bug in ``FormatBuf``
  3820. (`#493 <https://github.com/fmtlib/fmt/pull/493>`_).
  3821. Thanks `@effzeh <https://github.com/effzeh>`_. See also
  3822. `#480 <https://github.com/fmtlib/fmt/issues/480>`_ and
  3823. `#491 <https://github.com/fmtlib/fmt/issues/491>`_.
  3824. * Fixed handling of wide strings in ``fmt::StringWriter``.
  3825. * Improved compiler error messages
  3826. (`#357 <https://github.com/fmtlib/fmt/issues/357>`_).
  3827. * Fixed various warnings and issues with various compilers
  3828. (`#494 <https://github.com/fmtlib/fmt/pull/494>`_,
  3829. `#499 <https://github.com/fmtlib/fmt/pull/499>`_,
  3830. `#483 <https://github.com/fmtlib/fmt/pull/483>`_,
  3831. `#485 <https://github.com/fmtlib/fmt/pull/485>`_,
  3832. `#482 <https://github.com/fmtlib/fmt/pull/482>`_,
  3833. `#475 <https://github.com/fmtlib/fmt/pull/475>`_,
  3834. `#473 <https://github.com/fmtlib/fmt/pull/473>`_ and
  3835. `#414 <https://github.com/fmtlib/fmt/pull/414>`_).
  3836. Thanks `@chronoxor <https://github.com/chronoxor>`_,
  3837. `@zhaohuaxishi <https://github.com/zhaohuaxishi>`_,
  3838. `@pkestene (Pierre Kestener) <https://github.com/pkestene>`_,
  3839. `@dschmidt (Dominik Schmidt) <https://github.com/dschmidt>`_ and
  3840. `@0x414c (Alexey Gorishny) <https://github.com/0x414c>`_ .
  3841. * Improved CMake: targets are now namespaced
  3842. (`#511 <https://github.com/fmtlib/fmt/pull/511>`_ and
  3843. `#513 <https://github.com/fmtlib/fmt/pull/513>`_), supported header-only
  3844. ``printf.h`` (`#354 <https://github.com/fmtlib/fmt/pull/354>`_), fixed issue
  3845. with minimal supported library subset
  3846. (`#418 <https://github.com/fmtlib/fmt/issues/418>`_,
  3847. `#419 <https://github.com/fmtlib/fmt/pull/419>`_ and
  3848. `#420 <https://github.com/fmtlib/fmt/pull/420>`_).
  3849. Thanks `@bjoernthiel (Bjoern Thiel) <https://github.com/bjoernthiel>`_,
  3850. `@niosHD (Mario Werner) <https://github.com/niosHD>`_,
  3851. `@LogicalKnight (Sean LK) <https://github.com/LogicalKnight>`_ and
  3852. `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
  3853. * Improved documentation. Thanks to
  3854. `@pwm1234 (Phil) <https://github.com/pwm1234>`_ for
  3855. `#393 <https://github.com/fmtlib/fmt/pull/393>`_.
  3856. 3.0.2 - 2017-06-14
  3857. ------------------
  3858. * Added ``FMT_VERSION`` macro
  3859. (`#411 <https://github.com/fmtlib/fmt/issues/411>`_).
  3860. * Used ``FMT_NULL`` instead of literal ``0``
  3861. (`#409 <https://github.com/fmtlib/fmt/pull/409>`_).
  3862. Thanks `@alabuzhev (Alex Alabuzhev) <https://github.com/alabuzhev>`_.
  3863. * Added extern templates for ``format_float``
  3864. (`#413 <https://github.com/fmtlib/fmt/issues/413>`_).
  3865. * Fixed implicit conversion issue
  3866. (`#507 <https://github.com/fmtlib/fmt/issues/507>`_).
  3867. * Fixed signbit detection (`#423 <https://github.com/fmtlib/fmt/issues/423>`_).
  3868. * Fixed naming collision (`#425 <https://github.com/fmtlib/fmt/issues/425>`_).
  3869. * Fixed missing intrinsic for C++/CLI
  3870. (`#457 <https://github.com/fmtlib/fmt/pull/457>`_).
  3871. Thanks `@calumr (Calum Robinson) <https://github.com/calumr>`_
  3872. * Fixed Android detection (`#458 <https://github.com/fmtlib/fmt/pull/458>`_).
  3873. Thanks `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
  3874. * Use lean ``windows.h`` if not in header-only mode
  3875. (`#503 <https://github.com/fmtlib/fmt/pull/503>`_).
  3876. Thanks `@Quentin01 (Quentin Buathier) <https://github.com/Quentin01>`_.
  3877. * Fixed issue with CMake exporting C++11 flag
  3878. (`#445 <https://github.com/fmtlib/fmt/pull/455>`_).
  3879. Thanks `@EricWF (Eric) <https://github.com/EricWF>`_.
  3880. * Fixed issue with nvcc and MSVC compiler bug and MinGW
  3881. (`#505 <https://github.com/fmtlib/fmt/issues/505>`_).
  3882. * Fixed DLL issues (`#469 <https://github.com/fmtlib/fmt/pull/469>`_ and
  3883. `#502 <https://github.com/fmtlib/fmt/pull/502>`_).
  3884. Thanks `@richardeakin (Richard Eakin) <https://github.com/richardeakin>`_ and
  3885. `@AndreasSchoenle (Andreas Schönle) <https://github.com/AndreasSchoenle>`_.
  3886. * Fixed test compilation under FreeBSD
  3887. (`#433 <https://github.com/fmtlib/fmt/issues/433>`_).
  3888. * Fixed various warnings (`#403 <https://github.com/fmtlib/fmt/pull/403>`_,
  3889. `#410 <https://github.com/fmtlib/fmt/pull/410>`_ and
  3890. `#510 <https://github.com/fmtlib/fmt/pull/510>`_).
  3891. Thanks `@Lecetem <https://github.com/Lectem>`_,
  3892. `@chenhayat (Chen Hayat) <https://github.com/chenhayat>`_ and
  3893. `@trozen <https://github.com/trozen>`_.
  3894. * Worked around a broken ``__builtin_clz`` in clang with MS codegen
  3895. (`#519 <https://github.com/fmtlib/fmt/issues/519>`_).
  3896. * Removed redundant include
  3897. (`#479 <https://github.com/fmtlib/fmt/issues/479>`_).
  3898. * Fixed documentation issues.
  3899. 3.0.1 - 2016-11-01
  3900. ------------------
  3901. * Fixed handling of thousands separator
  3902. (`#353 <https://github.com/fmtlib/fmt/issues/353>`_).
  3903. * Fixed handling of ``unsigned char`` strings
  3904. (`#373 <https://github.com/fmtlib/fmt/issues/373>`_).
  3905. * Corrected buffer growth when formatting time
  3906. (`#367 <https://github.com/fmtlib/fmt/issues/367>`_).
  3907. * Removed warnings under MSVC and clang
  3908. (`#318 <https://github.com/fmtlib/fmt/issues/318>`_,
  3909. `#250 <https://github.com/fmtlib/fmt/issues/250>`_, also merged
  3910. `#385 <https://github.com/fmtlib/fmt/pull/385>`_ and
  3911. `#361 <https://github.com/fmtlib/fmt/pull/361>`_).
  3912. Thanks `@jcelerier (Jean-Michaël Celerier) <https://github.com/jcelerier>`_
  3913. and `@nmoehrle (Nils Moehrle) <https://github.com/nmoehrle>`_.
  3914. * Fixed compilation issues under Android
  3915. (`#327 <https://github.com/fmtlib/fmt/pull/327>`_,
  3916. `#345 <https://github.com/fmtlib/fmt/issues/345>`_ and
  3917. `#381 <https://github.com/fmtlib/fmt/pull/381>`_),
  3918. FreeBSD (`#358 <https://github.com/fmtlib/fmt/pull/358>`_),
  3919. Cygwin (`#388 <https://github.com/fmtlib/fmt/issues/388>`_),
  3920. MinGW (`#355 <https://github.com/fmtlib/fmt/issues/355>`_) as well as other
  3921. issues (`#350 <https://github.com/fmtlib/fmt/issues/350>`_,
  3922. `#366 <https://github.com/fmtlib/fmt/issues/355>`_,
  3923. `#348 <https://github.com/fmtlib/fmt/pull/348>`_,
  3924. `#402 <https://github.com/fmtlib/fmt/pull/402>`_,
  3925. `#405 <https://github.com/fmtlib/fmt/pull/405>`_).
  3926. Thanks to `@dpantele (Dmitry) <https://github.com/dpantele>`_,
  3927. `@hghwng (Hugh Wang) <https://github.com/hghwng>`_,
  3928. `@arvedarved (Tilman Keskinöz) <https://github.com/arvedarved>`_,
  3929. `@LogicalKnight (Sean) <https://github.com/LogicalKnight>`_ and
  3930. `@JanHellwig (Jan Hellwig) <https://github.com/janhellwig>`_.
  3931. * Fixed some documentation issues and extended specification
  3932. (`#320 <https://github.com/fmtlib/fmt/issues/320>`_,
  3933. `#333 <https://github.com/fmtlib/fmt/pull/333>`_,
  3934. `#347 <https://github.com/fmtlib/fmt/issues/347>`_,
  3935. `#362 <https://github.com/fmtlib/fmt/pull/362>`_).
  3936. Thanks to `@smellman (Taro Matsuzawa aka. btm)
  3937. <https://github.com/smellman>`_.
  3938. 3.0.0 - 2016-05-07
  3939. ------------------
  3940. * The project has been renamed from C++ Format (cppformat) to fmt for
  3941. consistency with the used namespace and macro prefix
  3942. (`#307 <https://github.com/fmtlib/fmt/issues/307>`_).
  3943. Library headers are now located in the ``fmt`` directory:
  3944. .. code:: c++
  3945. #include "fmt/format.h"
  3946. Including ``format.h`` from the ``cppformat`` directory is deprecated
  3947. but works via a proxy header which will be removed in the next major version.
  3948. The documentation is now available at https://fmt.dev.
  3949. * Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like
  3950. `date and time formatting <https://fmt.dev/3.0.0/api.html#date-and-time-formatting>`_
  3951. (`#283 <https://github.com/fmtlib/fmt/issues/283>`_):
  3952. .. code:: c++
  3953. #include "fmt/time.h"
  3954. std::time_t t = std::time(nullptr);
  3955. // Prints "The date is 2016-04-29." (with the current date)
  3956. fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t));
  3957. * ``std::ostream`` support including formatting of user-defined types that provide
  3958. overloaded ``operator<<`` has been moved to ``fmt/ostream.h``:
  3959. .. code:: c++
  3960. #include "fmt/ostream.h"
  3961. class Date {
  3962. int year_, month_, day_;
  3963. public:
  3964. Date(int year, int month, int day) : year_(year), month_(month), day_(day) {}
  3965. friend std::ostream &operator<<(std::ostream &os, const Date &d) {
  3966. return os << d.year_ << '-' << d.month_ << '-' << d.day_;
  3967. }
  3968. };
  3969. std::string s = fmt::format("The date is {}", Date(2012, 12, 9));
  3970. // s == "The date is 2012-12-9"
  3971. * Added support for `custom argument formatters
  3972. <https://fmt.dev/3.0.0/api.html#argument-formatters>`_
  3973. (`#235 <https://github.com/fmtlib/fmt/issues/235>`_).
  3974. * Added support for locale-specific integer formatting with the ``n`` specifier
  3975. (`#305 <https://github.com/fmtlib/fmt/issues/305>`_):
  3976. .. code:: c++
  3977. std::setlocale(LC_ALL, "en_US.utf8");
  3978. fmt::print("cppformat: {:n}\n", 1234567); // prints 1,234,567
  3979. * Sign is now preserved when formatting an integer with an incorrect ``printf``
  3980. format specifier (`#265 <https://github.com/fmtlib/fmt/issues/265>`_):
  3981. .. code:: c++
  3982. fmt::printf("%lld", -42); // prints -42
  3983. Note that it would be an undefined behavior in ``std::printf``.
  3984. * Length modifiers such as ``ll`` are now optional in printf formatting
  3985. functions and the correct type is determined automatically
  3986. (`#255 <https://github.com/fmtlib/fmt/issues/255>`_):
  3987. .. code:: c++
  3988. fmt::printf("%d", std::numeric_limits<long long>::max());
  3989. Note that it would be an undefined behavior in ``std::printf``.
  3990. * Added initial support for custom formatters
  3991. (`#231 <https://github.com/fmtlib/fmt/issues/231>`_).
  3992. * Fixed detection of user-defined literal support on Intel C++ compiler
  3993. (`#311 <https://github.com/fmtlib/fmt/issues/311>`_,
  3994. `#312 <https://github.com/fmtlib/fmt/pull/312>`_).
  3995. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_ and
  3996. `@speth (Ray Speth) <https://github.com/speth>`_.
  3997. * Reduced compile time
  3998. (`#243 <https://github.com/fmtlib/fmt/pull/243>`_,
  3999. `#249 <https://github.com/fmtlib/fmt/pull/249>`_,
  4000. `#317 <https://github.com/fmtlib/fmt/issues/317>`_):
  4001. .. image:: https://cloud.githubusercontent.com/assets/4831417/11614060/
  4002. b9e826d2-9c36-11e5-8666-d4131bf503ef.png
  4003. .. image:: https://cloud.githubusercontent.com/assets/4831417/11614080/
  4004. 6ac903cc-9c37-11e5-8165-26df6efae364.png
  4005. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
  4006. * Compile test fixes (`#313 <https://github.com/fmtlib/fmt/pull/313>`_).
  4007. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
  4008. * Documentation fixes (`#239 <https://github.com/fmtlib/fmt/pull/239>`_,
  4009. `#248 <https://github.com/fmtlib/fmt/issues/248>`_,
  4010. `#252 <https://github.com/fmtlib/fmt/issues/252>`_,
  4011. `#258 <https://github.com/fmtlib/fmt/pull/258>`_,
  4012. `#260 <https://github.com/fmtlib/fmt/issues/260>`_,
  4013. `#301 <https://github.com/fmtlib/fmt/issues/301>`_,
  4014. `#309 <https://github.com/fmtlib/fmt/pull/309>`_).
  4015. Thanks to `@ReadmeCritic <https://github.com/ReadmeCritic>`_
  4016. `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_ and
  4017. `@jwilk (Jakub Wilk) <https://github.com/jwilk>`_.
  4018. * Fixed compiler and sanitizer warnings
  4019. (`#244 <https://github.com/fmtlib/fmt/issues/244>`_,
  4020. `#256 <https://github.com/fmtlib/fmt/pull/256>`_,
  4021. `#259 <https://github.com/fmtlib/fmt/pull/259>`_,
  4022. `#263 <https://github.com/fmtlib/fmt/issues/263>`_,
  4023. `#274 <https://github.com/fmtlib/fmt/issues/274>`_,
  4024. `#277 <https://github.com/fmtlib/fmt/pull/277>`_,
  4025. `#286 <https://github.com/fmtlib/fmt/pull/286>`_,
  4026. `#291 <https://github.com/fmtlib/fmt/issues/291>`_,
  4027. `#296 <https://github.com/fmtlib/fmt/issues/296>`_,
  4028. `#308 <https://github.com/fmtlib/fmt/issues/308>`_)
  4029. Thanks to `@mwinterb <https://github.com/mwinterb>`_,
  4030. `@pweiskircher (Patrik Weiskircher) <https://github.com/pweiskircher>`_,
  4031. `@Naios <https://github.com/Naios>`_.
  4032. * Improved compatibility with Windows Store apps
  4033. (`#280 <https://github.com/fmtlib/fmt/issues/280>`_,
  4034. `#285 <https://github.com/fmtlib/fmt/pull/285>`_)
  4035. Thanks to `@mwinterb <https://github.com/mwinterb>`_.
  4036. * Added tests of compatibility with older C++ standards
  4037. (`#273 <https://github.com/fmtlib/fmt/pull/273>`_).
  4038. Thanks to `@niosHD <https://github.com/niosHD>`_.
  4039. * Fixed Android build (`#271 <https://github.com/fmtlib/fmt/pull/271>`_).
  4040. Thanks to `@newnon <https://github.com/newnon>`_.
  4041. * Changed ``ArgMap`` to be backed by a vector instead of a map.
  4042. (`#261 <https://github.com/fmtlib/fmt/issues/261>`_,
  4043. `#262 <https://github.com/fmtlib/fmt/pull/262>`_).
  4044. Thanks to `@mwinterb <https://github.com/mwinterb>`_.
  4045. * Added ``fprintf`` overload that writes to a ``std::ostream``
  4046. (`#251 <https://github.com/fmtlib/fmt/pull/251>`_).
  4047. Thanks to `nickhutchinson (Nicholas Hutchinson) <https://github.com/nickhutchinson>`_.
  4048. * Export symbols when building a Windows DLL
  4049. (`#245 <https://github.com/fmtlib/fmt/pull/245>`_).
  4050. Thanks to `macdems (Maciek Dems) <https://github.com/macdems>`_.
  4051. * Fixed compilation on Cygwin (`#304 <https://github.com/fmtlib/fmt/issues/304>`_).
  4052. * Implemented a workaround for a bug in Apple LLVM version 4.2 of clang
  4053. (`#276 <https://github.com/fmtlib/fmt/issues/276>`_).
  4054. * Implemented a workaround for Google Test bug
  4055. `#705 <https://github.com/google/googletest/issues/705>`_ on gcc 6
  4056. (`#268 <https://github.com/fmtlib/fmt/issues/268>`_).
  4057. Thanks to `octoploid <https://github.com/octoploid>`_.
  4058. * Removed Biicode support because the latter has been discontinued.
  4059. 2.1.1 - 2016-04-11
  4060. ------------------
  4061. * The install location for generated CMake files is now configurable via
  4062. the ``FMT_CMAKE_DIR`` CMake variable
  4063. (`#299 <https://github.com/fmtlib/fmt/pull/299>`_).
  4064. Thanks to `@niosHD <https://github.com/niosHD>`_.
  4065. * Documentation fixes (`#252 <https://github.com/fmtlib/fmt/issues/252>`_).
  4066. 2.1.0 - 2016-03-21
  4067. ------------------
  4068. * Project layout and build system improvements
  4069. (`#267 <https://github.com/fmtlib/fmt/pull/267>`_):
  4070. * The code have been moved to the ``cppformat`` directory.
  4071. Including ``format.h`` from the top-level directory is deprecated
  4072. but works via a proxy header which will be removed in the next
  4073. major version.
  4074. * C++ Format CMake targets now have proper interface definitions.
  4075. * Installed version of the library now supports the header-only
  4076. configuration.
  4077. * Targets ``doc``, ``install``, and ``test`` are now disabled if C++ Format
  4078. is included as a CMake subproject. They can be enabled by setting
  4079. ``FMT_DOC``, ``FMT_INSTALL``, and ``FMT_TEST`` in the parent project.
  4080. Thanks to `@niosHD <https://github.com/niosHD>`_.
  4081. 2.0.1 - 2016-03-13
  4082. ------------------
  4083. * Improved CMake find and package support
  4084. (`#264 <https://github.com/fmtlib/fmt/issues/264>`_).
  4085. Thanks to `@niosHD <https://github.com/niosHD>`_.
  4086. * Fix compile error with Android NDK and mingw32
  4087. (`#241 <https://github.com/fmtlib/fmt/issues/241>`_).
  4088. Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
  4089. * Documentation fixes
  4090. (`#248 <https://github.com/fmtlib/fmt/issues/248>`_,
  4091. `#260 <https://github.com/fmtlib/fmt/issues/260>`_).
  4092. 2.0.0 - 2015-12-01
  4093. ------------------
  4094. General
  4095. ~~~~~~~
  4096. * [Breaking] Named arguments
  4097. (`#169 <https://github.com/fmtlib/fmt/pull/169>`_,
  4098. `#173 <https://github.com/fmtlib/fmt/pull/173>`_,
  4099. `#174 <https://github.com/fmtlib/fmt/pull/174>`_):
  4100. .. code:: c++
  4101. fmt::print("The answer is {answer}.", fmt::arg("answer", 42));
  4102. Thanks to `@jamboree <https://github.com/jamboree>`_.
  4103. * [Experimental] User-defined literals for format and named arguments
  4104. (`#204 <https://github.com/fmtlib/fmt/pull/204>`_,
  4105. `#206 <https://github.com/fmtlib/fmt/pull/206>`_,
  4106. `#207 <https://github.com/fmtlib/fmt/pull/207>`_):
  4107. .. code:: c++
  4108. using namespace fmt::literals;
  4109. fmt::print("The answer is {answer}.", "answer"_a=42);
  4110. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
  4111. * [Breaking] Formatting of more than 16 arguments is now supported when using
  4112. variadic templates
  4113. (`#141 <https://github.com/fmtlib/fmt/issues/141>`_).
  4114. Thanks to `@Shauren <https://github.com/Shauren>`_.
  4115. * Runtime width specification
  4116. (`#168 <https://github.com/fmtlib/fmt/pull/168>`_):
  4117. .. code:: c++
  4118. fmt::format("{0:{1}}", 42, 5); // gives " 42"
  4119. Thanks to `@jamboree <https://github.com/jamboree>`_.
  4120. * [Breaking] Enums are now formatted with an overloaded ``std::ostream`` insertion
  4121. operator (``operator<<``) if available
  4122. (`#232 <https://github.com/fmtlib/fmt/issues/232>`_).
  4123. * [Breaking] Changed default ``bool`` format to textual, "true" or "false"
  4124. (`#170 <https://github.com/fmtlib/fmt/issues/170>`_):
  4125. .. code:: c++
  4126. fmt::print("{}", true); // prints "true"
  4127. To print ``bool`` as a number use numeric format specifier such as ``d``:
  4128. .. code:: c++
  4129. fmt::print("{:d}", true); // prints "1"
  4130. * ``fmt::printf`` and ``fmt::sprintf`` now support formatting of ``bool`` with the
  4131. ``%s`` specifier giving textual output, "true" or "false"
  4132. (`#223 <https://github.com/fmtlib/fmt/pull/223>`_):
  4133. .. code:: c++
  4134. fmt::printf("%s", true); // prints "true"
  4135. Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
  4136. * [Breaking] ``signed char`` and ``unsigned char`` are now formatted as integers by default
  4137. (`#217 <https://github.com/fmtlib/fmt/pull/217>`_).
  4138. * [Breaking] Pointers to C strings can now be formatted with the ``p`` specifier
  4139. (`#223 <https://github.com/fmtlib/fmt/pull/223>`_):
  4140. .. code:: c++
  4141. fmt::print("{:p}", "test"); // prints pointer value
  4142. Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
  4143. * [Breaking] ``fmt::printf`` and ``fmt::sprintf`` now print null pointers as ``(nil)``
  4144. and null strings as ``(null)`` for consistency with glibc
  4145. (`#226 <https://github.com/fmtlib/fmt/pull/226>`_).
  4146. Thanks to `@LarsGullik <https://github.com/LarsGullik>`_.
  4147. * [Breaking] ``fmt::(s)printf`` now supports formatting of objects of user-defined types
  4148. that provide an overloaded ``std::ostream`` insertion operator (``operator<<``)
  4149. (`#201 <https://github.com/fmtlib/fmt/issues/201>`_):
  4150. .. code:: c++
  4151. fmt::printf("The date is %s", Date(2012, 12, 9));
  4152. * [Breaking] The ``Buffer`` template is now part of the public API and can be used
  4153. to implement custom memory buffers
  4154. (`#140 <https://github.com/fmtlib/fmt/issues/140>`_).
  4155. Thanks to `@polyvertex (Jean-Charles Lefebvre) <https://github.com/polyvertex>`_.
  4156. * [Breaking] Improved compatibility between ``BasicStringRef`` and
  4157. `std::experimental::basic_string_view
  4158. <http://en.cppreference.com/w/cpp/experimental/basic_string_view>`_
  4159. (`#100 <https://github.com/fmtlib/fmt/issues/100>`_,
  4160. `#159 <https://github.com/fmtlib/fmt/issues/159>`_,
  4161. `#183 <https://github.com/fmtlib/fmt/issues/183>`_):
  4162. - Comparison operators now compare string content, not pointers
  4163. - ``BasicStringRef::c_str`` replaced by ``BasicStringRef::data``
  4164. - ``BasicStringRef`` is no longer assumed to be null-terminated
  4165. References to null-terminated strings are now represented by a new class,
  4166. ``BasicCStringRef``.
  4167. * Dependency on pthreads introduced by Google Test is now optional
  4168. (`#185 <https://github.com/fmtlib/fmt/issues/185>`_).
  4169. * New CMake options ``FMT_DOC``, ``FMT_INSTALL`` and ``FMT_TEST`` to control
  4170. generation of ``doc``, ``install`` and ``test`` targets respectively, on by default
  4171. (`#197 <https://github.com/fmtlib/fmt/issues/197>`_,
  4172. `#198 <https://github.com/fmtlib/fmt/issues/198>`_,
  4173. `#200 <https://github.com/fmtlib/fmt/issues/200>`_).
  4174. Thanks to `@maddinat0r (Alex Martin) <https://github.com/maddinat0r>`_.
  4175. * ``noexcept`` is now used when compiling with MSVC2015
  4176. (`#215 <https://github.com/fmtlib/fmt/pull/215>`_).
  4177. Thanks to `@dmkrepo (Dmitriy) <https://github.com/dmkrepo>`_.
  4178. * Added an option to disable use of ``windows.h`` when ``FMT_USE_WINDOWS_H``
  4179. is defined as 0 before including ``format.h``
  4180. (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
  4181. Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
  4182. * [Breaking] ``windows.h`` is now included with ``NOMINMAX`` unless
  4183. ``FMT_WIN_MINMAX`` is defined. This is done to prevent breaking code using
  4184. ``std::min`` and ``std::max`` and only affects the header-only configuration
  4185. (`#152 <https://github.com/fmtlib/fmt/issues/152>`_,
  4186. `#153 <https://github.com/fmtlib/fmt/pull/153>`_,
  4187. `#154 <https://github.com/fmtlib/fmt/pull/154>`_).
  4188. Thanks to `@DevO2012 <https://github.com/DevO2012>`_.
  4189. * Improved support for custom character types
  4190. (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
  4191. Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
  4192. * Added an option to disable use of IOStreams when ``FMT_USE_IOSTREAMS``
  4193. is defined as 0 before including ``format.h``
  4194. (`#205 <https://github.com/fmtlib/fmt/issues/205>`_,
  4195. `#208 <https://github.com/fmtlib/fmt/pull/208>`_).
  4196. Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_.
  4197. * Improved detection of ``isnan``, ``isinf`` and ``signbit``.
  4198. Optimization
  4199. ~~~~~~~~~~~~
  4200. * Made formatting of user-defined types more efficient with a custom stream buffer
  4201. (`#92 <https://github.com/fmtlib/fmt/issues/92>`_,
  4202. `#230 <https://github.com/fmtlib/fmt/pull/230>`_).
  4203. Thanks to `@NotImplemented <https://github.com/NotImplemented>`_.
  4204. * Further improved performance of ``fmt::Writer`` on integer formatting
  4205. and fixed a minor regression. Now it is ~7% faster than ``karma::generate``
  4206. on Karma's benchmark
  4207. (`#186 <https://github.com/fmtlib/fmt/issues/186>`_).
  4208. * [Breaking] Reduced `compiled code size
  4209. <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_
  4210. (`#143 <https://github.com/fmtlib/fmt/issues/143>`_,
  4211. `#149 <https://github.com/fmtlib/fmt/pull/149>`_).
  4212. Distribution
  4213. ~~~~~~~~~~~~
  4214. * [Breaking] Headers are now installed in
  4215. ``${CMAKE_INSTALL_PREFIX}/include/cppformat``
  4216. (`#178 <https://github.com/fmtlib/fmt/issues/178>`_).
  4217. Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
  4218. * [Breaking] Changed the library name from ``format`` to ``cppformat``
  4219. for consistency with the project name and to avoid potential conflicts
  4220. (`#178 <https://github.com/fmtlib/fmt/issues/178>`_).
  4221. Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
  4222. * C++ Format is now available in `Debian <https://www.debian.org/>`_ GNU/Linux
  4223. (`stretch <https://packages.debian.org/source/stretch/cppformat>`_,
  4224. `sid <https://packages.debian.org/source/sid/cppformat>`_) and
  4225. derived distributions such as
  4226. `Ubuntu <https://launchpad.net/ubuntu/+source/cppformat>`_ 15.10 and later
  4227. (`#155 <https://github.com/fmtlib/fmt/issues/155>`_)::
  4228. $ sudo apt-get install libcppformat1-dev
  4229. Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
  4230. * `Packages for Fedora and RHEL <https://admin.fedoraproject.org/pkgdb/package/cppformat/>`_
  4231. are now available. Thanks to Dave Johansen.
  4232. * C++ Format can now be installed via `Homebrew <http://brew.sh/>`_ on OS X
  4233. (`#157 <https://github.com/fmtlib/fmt/issues/157>`_)::
  4234. $ brew install cppformat
  4235. Thanks to `@ortho <https://github.com/ortho>`_, Anatoliy Bulukin.
  4236. Documentation
  4237. ~~~~~~~~~~~~~
  4238. * Migrated from ReadTheDocs to GitHub Pages for better responsiveness
  4239. and reliability
  4240. (`#128 <https://github.com/fmtlib/fmt/issues/128>`_).
  4241. New documentation address is http://cppformat.github.io/.
  4242. * Added `Building the documentation
  4243. <https://fmt.dev/2.0.0/usage.html#building-the-documentation>`_
  4244. section to the documentation.
  4245. * Documentation build script is now compatible with Python 3 and newer pip versions.
  4246. (`#189 <https://github.com/fmtlib/fmt/pull/189>`_,
  4247. `#209 <https://github.com/fmtlib/fmt/issues/209>`_).
  4248. Thanks to `@JodiTheTigger <https://github.com/JodiTheTigger>`_ and
  4249. `@xentec <https://github.com/xentec>`_.
  4250. * Documentation fixes and improvements
  4251. (`#36 <https://github.com/fmtlib/fmt/issues/36>`_,
  4252. `#75 <https://github.com/fmtlib/fmt/issues/75>`_,
  4253. `#125 <https://github.com/fmtlib/fmt/issues/125>`_,
  4254. `#160 <https://github.com/fmtlib/fmt/pull/160>`_,
  4255. `#161 <https://github.com/fmtlib/fmt/pull/161>`_,
  4256. `#162 <https://github.com/fmtlib/fmt/issues/162>`_,
  4257. `#165 <https://github.com/fmtlib/fmt/issues/165>`_,
  4258. `#210 <https://github.com/fmtlib/fmt/issues/210>`_).
  4259. Thanks to `@syohex (Syohei YOSHIDA) <https://github.com/syohex>`_ and
  4260. bug reporters.
  4261. * Fixed out-of-tree documentation build
  4262. (`#177 <https://github.com/fmtlib/fmt/issues/177>`_).
  4263. Thanks to `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_.
  4264. Fixes
  4265. ~~~~~
  4266. * Fixed ``initializer_list`` detection
  4267. (`#136 <https://github.com/fmtlib/fmt/issues/136>`_).
  4268. Thanks to `@Gachapen (Magnus Bjerke Vik) <https://github.com/Gachapen>`_.
  4269. * [Breaking] Fixed formatting of enums with numeric format specifiers in
  4270. ``fmt::(s)printf``
  4271. (`#131 <https://github.com/fmtlib/fmt/issues/131>`_,
  4272. `#139 <https://github.com/fmtlib/fmt/issues/139>`_):
  4273. .. code:: c++
  4274. enum { ANSWER = 42 };
  4275. fmt::printf("%d", ANSWER);
  4276. Thanks to `@Naios <https://github.com/Naios>`_.
  4277. * Improved compatibility with old versions of MinGW
  4278. (`#129 <https://github.com/fmtlib/fmt/issues/129>`_,
  4279. `#130 <https://github.com/fmtlib/fmt/pull/130>`_,
  4280. `#132 <https://github.com/fmtlib/fmt/issues/132>`_).
  4281. Thanks to `@cstamford (Christopher Stamford) <https://github.com/cstamford>`_.
  4282. * Fixed a compile error on MSVC with disabled exceptions
  4283. (`#144 <https://github.com/fmtlib/fmt/issues/144>`_).
  4284. * Added a workaround for broken implementation of variadic templates in MSVC2012
  4285. (`#148 <https://github.com/fmtlib/fmt/issues/148>`_).
  4286. * Placed the anonymous namespace within ``fmt`` namespace for the header-only
  4287. configuration
  4288. (`#171 <https://github.com/fmtlib/fmt/issues/171>`_).
  4289. Thanks to `@alfps (Alf P. Steinbach) <https://github.com/alfps>`_.
  4290. * Fixed issues reported by Coverity Scan
  4291. (`#187 <https://github.com/fmtlib/fmt/issues/187>`_,
  4292. `#192 <https://github.com/fmtlib/fmt/issues/192>`_).
  4293. * Implemented a workaround for a name lookup bug in MSVC2010
  4294. (`#188 <https://github.com/fmtlib/fmt/issues/188>`_).
  4295. * Fixed compiler warnings
  4296. (`#95 <https://github.com/fmtlib/fmt/issues/95>`_,
  4297. `#96 <https://github.com/fmtlib/fmt/issues/96>`_,
  4298. `#114 <https://github.com/fmtlib/fmt/pull/114>`_,
  4299. `#135 <https://github.com/fmtlib/fmt/issues/135>`_,
  4300. `#142 <https://github.com/fmtlib/fmt/issues/142>`_,
  4301. `#145 <https://github.com/fmtlib/fmt/issues/145>`_,
  4302. `#146 <https://github.com/fmtlib/fmt/issues/146>`_,
  4303. `#158 <https://github.com/fmtlib/fmt/issues/158>`_,
  4304. `#163 <https://github.com/fmtlib/fmt/issues/163>`_,
  4305. `#175 <https://github.com/fmtlib/fmt/issues/175>`_,
  4306. `#190 <https://github.com/fmtlib/fmt/issues/190>`_,
  4307. `#191 <https://github.com/fmtlib/fmt/pull/191>`_,
  4308. `#194 <https://github.com/fmtlib/fmt/issues/194>`_,
  4309. `#196 <https://github.com/fmtlib/fmt/pull/196>`_,
  4310. `#216 <https://github.com/fmtlib/fmt/issues/216>`_,
  4311. `#218 <https://github.com/fmtlib/fmt/pull/218>`_,
  4312. `#220 <https://github.com/fmtlib/fmt/pull/220>`_,
  4313. `#229 <https://github.com/fmtlib/fmt/pull/229>`_,
  4314. `#233 <https://github.com/fmtlib/fmt/issues/233>`_,
  4315. `#234 <https://github.com/fmtlib/fmt/issues/234>`_,
  4316. `#236 <https://github.com/fmtlib/fmt/pull/236>`_,
  4317. `#281 <https://github.com/fmtlib/fmt/issues/281>`_,
  4318. `#289 <https://github.com/fmtlib/fmt/issues/289>`_).
  4319. Thanks to `@seanmiddleditch (Sean Middleditch) <https://github.com/seanmiddleditch>`_,
  4320. `@dixlorenz (Dix Lorenz) <https://github.com/dixlorenz>`_,
  4321. `@CarterLi (李通洲) <https://github.com/CarterLi>`_,
  4322. `@Naios <https://github.com/Naios>`_,
  4323. `@fmatthew5876 (Matthew Fioravante) <https://github.com/fmatthew5876>`_,
  4324. `@LevskiWeng (Levski Weng) <https://github.com/LevskiWeng>`_,
  4325. `@rpopescu <https://github.com/rpopescu>`_,
  4326. `@gabime (Gabi Melman) <https://github.com/gabime>`_,
  4327. `@cubicool (Jeremy Moles) <https://github.com/cubicool>`_,
  4328. `@jkflying (Julian Kent) <https://github.com/jkflying>`_,
  4329. `@LogicalKnight (Sean L) <https://github.com/LogicalKnight>`_,
  4330. `@inguin (Ingo van Lil) <https://github.com/inguin>`_ and
  4331. `@Jopie64 (Johan) <https://github.com/Jopie64>`_.
  4332. * Fixed portability issues (mostly causing test failures) on ARM, ppc64, ppc64le,
  4333. s390x and SunOS 5.11 i386
  4334. (`#138 <https://github.com/fmtlib/fmt/issues/138>`_,
  4335. `#179 <https://github.com/fmtlib/fmt/issues/179>`_,
  4336. `#180 <https://github.com/fmtlib/fmt/issues/180>`_,
  4337. `#202 <https://github.com/fmtlib/fmt/issues/202>`_,
  4338. `#225 <https://github.com/fmtlib/fmt/issues/225>`_,
  4339. `Red Hat Bugzilla Bug 1260297 <https://bugzilla.redhat.com/show_bug.cgi?id=1260297>`_).
  4340. Thanks to `@Naios <https://github.com/Naios>`_,
  4341. `@jackyf (Eugene V. Lyubimkin) <https://github.com/jackyf>`_ and Dave Johansen.
  4342. * Fixed a name conflict with macro ``free`` defined in
  4343. ``crtdbg.h`` when ``_CRTDBG_MAP_ALLOC`` is set
  4344. (`#211 <https://github.com/fmtlib/fmt/issues/211>`_).
  4345. * Fixed shared library build on OS X
  4346. (`#212 <https://github.com/fmtlib/fmt/pull/212>`_).
  4347. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
  4348. * Fixed an overload conflict on MSVC when ``/Zc:wchar_t-`` option is specified
  4349. (`#214 <https://github.com/fmtlib/fmt/pull/214>`_).
  4350. Thanks to `@slavanap (Vyacheslav Napadovsky) <https://github.com/slavanap>`_.
  4351. * Improved compatibility with MSVC 2008
  4352. (`#236 <https://github.com/fmtlib/fmt/pull/236>`_).
  4353. Thanks to `@Jopie64 (Johan) <https://github.com/Jopie64>`_.
  4354. * Improved compatibility with bcc32
  4355. (`#227 <https://github.com/fmtlib/fmt/issues/227>`_).
  4356. * Fixed ``static_assert`` detection on Clang
  4357. (`#228 <https://github.com/fmtlib/fmt/pull/228>`_).
  4358. Thanks to `@dean0x7d (Dean Moldovan) <https://github.com/dean0x7d>`_.
  4359. 1.1.0 - 2015-03-06
  4360. ------------------
  4361. * Added ``BasicArrayWriter``, a class template that provides operations for
  4362. formatting and writing data into a fixed-size array
  4363. (`#105 <https://github.com/fmtlib/fmt/issues/105>`_ and
  4364. `#122 <https://github.com/fmtlib/fmt/issues/122>`_):
  4365. .. code:: c++
  4366. char buffer[100];
  4367. fmt::ArrayWriter w(buffer);
  4368. w.write("The answer is {}", 42);
  4369. * Added `0 A.D. <http://play0ad.com/>`_ and `PenUltima Online (POL)
  4370. <http://www.polserver.com/>`_ to the list of notable projects using C++ Format.
  4371. * C++ Format now uses MSVC intrinsics for better formatting performance
  4372. (`#115 <https://github.com/fmtlib/fmt/pull/115>`_,
  4373. `#116 <https://github.com/fmtlib/fmt/pull/116>`_,
  4374. `#118 <https://github.com/fmtlib/fmt/pull/118>`_ and
  4375. `#121 <https://github.com/fmtlib/fmt/pull/121>`_).
  4376. Previously these optimizations where only used on GCC and Clang.
  4377. Thanks to `@CarterLi <https://github.com/CarterLi>`_ and
  4378. `@objectx <https://github.com/objectx>`_.
  4379. * CMake install target (`#119 <https://github.com/fmtlib/fmt/pull/119>`_).
  4380. Thanks to `@TrentHouliston <https://github.com/TrentHouliston>`_.
  4381. You can now install C++ Format with ``make install`` command.
  4382. * Improved `Biicode <http://www.biicode.com/>`_ support
  4383. (`#98 <https://github.com/fmtlib/fmt/pull/98>`_ and
  4384. `#104 <https://github.com/fmtlib/fmt/pull/104>`_). Thanks to
  4385. `@MariadeAnton <https://github.com/MariadeAnton>`_ and
  4386. `@franramirez688 <https://github.com/franramirez688>`_.
  4387. * Improved support for building with `Android NDK
  4388. <https://developer.android.com/tools/sdk/ndk/index.html>`_
  4389. (`#107 <https://github.com/fmtlib/fmt/pull/107>`_).
  4390. Thanks to `@newnon <https://github.com/newnon>`_.
  4391. The `android-ndk-example <https://github.com/fmtlib/android-ndk-example>`_
  4392. repository provides and example of using C++ Format with Android NDK:
  4393. .. image:: https://raw.githubusercontent.com/fmtlib/android-ndk-example/
  4394. master/screenshot.png
  4395. * Improved documentation of ``SystemError`` and ``WindowsError``
  4396. (`#54 <https://github.com/fmtlib/fmt/issues/54>`_).
  4397. * Various code improvements
  4398. (`#110 <https://github.com/fmtlib/fmt/pull/110>`_,
  4399. `#111 <https://github.com/fmtlib/fmt/pull/111>`_
  4400. `#112 <https://github.com/fmtlib/fmt/pull/112>`_).
  4401. Thanks to `@CarterLi <https://github.com/CarterLi>`_.
  4402. * Improved compile-time errors when formatting wide into narrow strings
  4403. (`#117 <https://github.com/fmtlib/fmt/issues/117>`_).
  4404. * Fixed ``BasicWriter::write`` without formatting arguments when C++11 support
  4405. is disabled (`#109 <https://github.com/fmtlib/fmt/issues/109>`_).
  4406. * Fixed header-only build on OS X with GCC 4.9
  4407. (`#124 <https://github.com/fmtlib/fmt/issues/124>`_).
  4408. * Fixed packaging issues (`#94 <https://github.com/fmtlib/fmt/issues/94>`_).
  4409. * Added `changelog <https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst>`_
  4410. (`#103 <https://github.com/fmtlib/fmt/issues/103>`_).
  4411. 1.0.0 - 2015-02-05
  4412. ------------------
  4413. * Add support for a header-only configuration when ``FMT_HEADER_ONLY`` is
  4414. defined before including ``format.h``:
  4415. .. code:: c++
  4416. #define FMT_HEADER_ONLY
  4417. #include "format.h"
  4418. * Compute string length in the constructor of ``BasicStringRef``
  4419. instead of the ``size`` method
  4420. (`#79 <https://github.com/fmtlib/fmt/issues/79>`_).
  4421. This eliminates size computation for string literals on reasonable optimizing
  4422. compilers.
  4423. * Fix formatting of types with overloaded ``operator <<`` for ``std::wostream``
  4424. (`#86 <https://github.com/fmtlib/fmt/issues/86>`_):
  4425. .. code:: c++
  4426. fmt::format(L"The date is {0}", Date(2012, 12, 9));
  4427. * Fix linkage of tests on Arch Linux
  4428. (`#89 <https://github.com/fmtlib/fmt/issues/89>`_).
  4429. * Allow precision specifier for non-float arguments
  4430. (`#90 <https://github.com/fmtlib/fmt/issues/90>`_):
  4431. .. code:: c++
  4432. fmt::print("{:.3}\n", "Carpet"); // prints "Car"
  4433. * Fix build on Android NDK
  4434. (`#93 <https://github.com/fmtlib/fmt/issues/93>`_)
  4435. * Improvements to documentation build procedure.
  4436. * Remove ``FMT_SHARED`` CMake variable in favor of standard `BUILD_SHARED_LIBS
  4437. <http://www.cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html>`_.
  4438. * Fix error handling in ``fmt::fprintf``.
  4439. * Fix a number of warnings.
  4440. 0.12.0 - 2014-10-25
  4441. -------------------
  4442. * [Breaking] Improved separation between formatting and buffer management.
  4443. ``Writer`` is now a base class that cannot be instantiated directly.
  4444. The new ``MemoryWriter`` class implements the default buffer management
  4445. with small allocations done on stack. So ``fmt::Writer`` should be replaced
  4446. with ``fmt::MemoryWriter`` in variable declarations.
  4447. Old code:
  4448. .. code:: c++
  4449. fmt::Writer w;
  4450. New code:
  4451. .. code:: c++
  4452. fmt::MemoryWriter w;
  4453. If you pass ``fmt::Writer`` by reference, you can continue to do so:
  4454. .. code:: c++
  4455. void f(fmt::Writer &w);
  4456. This doesn't affect the formatting API.
  4457. * Support for custom memory allocators
  4458. (`#69 <https://github.com/fmtlib/fmt/issues/69>`_)
  4459. * Formatting functions now accept `signed char` and `unsigned char` strings as
  4460. arguments (`#73 <https://github.com/fmtlib/fmt/issues/73>`_):
  4461. .. code:: c++
  4462. auto s = format("GLSL version: {}", glGetString(GL_VERSION));
  4463. * Reduced code bloat. According to the new `benchmark results
  4464. <https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_,
  4465. cppformat is close to ``printf`` and by the order of magnitude better than
  4466. Boost Format in terms of compiled code size.
  4467. * Improved appearance of the documentation on mobile by using the `Sphinx
  4468. Bootstrap theme <http://ryan-roemer.github.io/sphinx-bootstrap-theme/>`_:
  4469. .. |old| image:: https://cloud.githubusercontent.com/assets/576385/4792130/
  4470. cd256436-5de3-11e4-9a62-c077d0c2b003.png
  4471. .. |new| image:: https://cloud.githubusercontent.com/assets/576385/4792131/
  4472. cd29896c-5de3-11e4-8f59-cac952942bf0.png
  4473. +-------+-------+
  4474. | Old | New |
  4475. +-------+-------+
  4476. | |old| | |new| |
  4477. +-------+-------+
  4478. 0.11.0 - 2014-08-21
  4479. -------------------
  4480. * Safe printf implementation with a POSIX extension for positional arguments:
  4481. .. code:: c++
  4482. fmt::printf("Elapsed time: %.2f seconds", 1.23);
  4483. fmt::printf("%1$s, %3$d %2$s", weekday, month, day);
  4484. * Arguments of ``char`` type can now be formatted as integers
  4485. (Issue `#55 <https://github.com/fmtlib/fmt/issues/55>`_):
  4486. .. code:: c++
  4487. fmt::format("0x{0:02X}", 'a');
  4488. * Deprecated parts of the API removed.
  4489. * The library is now built and tested on MinGW with Appveyor in addition to
  4490. existing test platforms Linux/GCC, OS X/Clang, Windows/MSVC.
  4491. 0.10.0 - 2014-07-01
  4492. -------------------
  4493. **Improved API**
  4494. * All formatting methods are now implemented as variadic functions instead
  4495. of using ``operator<<`` for feeding arbitrary arguments into a temporary
  4496. formatter object. This works both with C++11 where variadic templates are
  4497. used and with older standards where variadic functions are emulated by
  4498. providing lightweight wrapper functions defined with the ``FMT_VARIADIC``
  4499. macro. You can use this macro for defining your own portable variadic
  4500. functions:
  4501. .. code:: c++
  4502. void report_error(const char *format, const fmt::ArgList &args) {
  4503. fmt::print("Error: {}");
  4504. fmt::print(format, args);
  4505. }
  4506. FMT_VARIADIC(void, report_error, const char *)
  4507. report_error("file not found: {}", path);
  4508. Apart from a more natural syntax, this also improves performance as there
  4509. is no need to construct temporary formatter objects and control arguments'
  4510. lifetimes. Because the wrapper functions are very lightweight, this doesn't
  4511. cause code bloat even in pre-C++11 mode.
  4512. * Simplified common case of formatting an ``std::string``. Now it requires a
  4513. single function call:
  4514. .. code:: c++
  4515. std::string s = format("The answer is {}.", 42);
  4516. Previously it required 2 function calls:
  4517. .. code:: c++
  4518. std::string s = str(Format("The answer is {}.") << 42);
  4519. Instead of unsafe ``c_str`` function, ``fmt::Writer`` should be used directly
  4520. to bypass creation of ``std::string``:
  4521. .. code:: c++
  4522. fmt::Writer w;
  4523. w.write("The answer is {}.", 42);
  4524. w.c_str(); // returns a C string
  4525. This doesn't do dynamic memory allocation for small strings and is less error
  4526. prone as the lifetime of the string is the same as for ``std::string::c_str``
  4527. which is well understood (hopefully).
  4528. * Improved consistency in naming functions that are a part of the public API.
  4529. Now all public functions are lowercase following the standard library
  4530. conventions. Previously it was a combination of lowercase and
  4531. CapitalizedWords.
  4532. Issue `#50 <https://github.com/fmtlib/fmt/issues/50>`_.
  4533. * Old functions are marked as deprecated and will be removed in the next
  4534. release.
  4535. **Other Changes**
  4536. * Experimental support for printf format specifications (work in progress):
  4537. .. code:: c++
  4538. fmt::printf("The answer is %d.", 42);
  4539. std::string s = fmt::sprintf("Look, a %s!", "string");
  4540. * Support for hexadecimal floating point format specifiers ``a`` and ``A``:
  4541. .. code:: c++
  4542. print("{:a}", -42.0); // Prints -0x1.5p+5
  4543. print("{:A}", -42.0); // Prints -0X1.5P+5
  4544. * CMake option ``FMT_SHARED`` that specifies whether to build format as a
  4545. shared library (off by default).
  4546. 0.9.0 - 2014-05-13
  4547. ------------------
  4548. * More efficient implementation of variadic formatting functions.
  4549. * ``Writer::Format`` now has a variadic overload:
  4550. .. code:: c++
  4551. Writer out;
  4552. out.Format("Look, I'm {}!", "variadic");
  4553. * For efficiency and consistency with other overloads, variadic overload of
  4554. the ``Format`` function now returns ``Writer`` instead of ``std::string``.
  4555. Use the ``str`` function to convert it to ``std::string``:
  4556. .. code:: c++
  4557. std::string s = str(Format("Look, I'm {}!", "variadic"));
  4558. * Replaced formatter actions with output sinks: ``NoAction`` -> ``NullSink``,
  4559. ``Write`` -> ``FileSink``, ``ColorWriter`` -> ``ANSITerminalSink``.
  4560. This improves naming consistency and shouldn't affect client code unless
  4561. these classes are used directly which should be rarely needed.
  4562. * Added ``ThrowSystemError`` function that formats a message and throws
  4563. ``SystemError`` containing the formatted message and system-specific error
  4564. description. For example, the following code
  4565. .. code:: c++
  4566. FILE *f = fopen(filename, "r");
  4567. if (!f)
  4568. ThrowSystemError(errno, "Failed to open file '{}'") << filename;
  4569. will throw ``SystemError`` exception with description
  4570. "Failed to open file '<filename>': No such file or directory" if file
  4571. doesn't exist.
  4572. * Support for AppVeyor continuous integration platform.
  4573. * ``Format`` now throws ``SystemError`` in case of I/O errors.
  4574. * Improve test infrastructure. Print functions are now tested by redirecting
  4575. the output to a pipe.
  4576. 0.8.0 - 2014-04-14
  4577. ------------------
  4578. * Initial release