ChangeLog.rst 186 KB

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