ChangeLog.rst 207 KB

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