Changelog¶
All notable changes to the dross project will be documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased¶
Added¶
Notifications between processes.
broadcaster::create()given a place, such as anipc::unix_socket, publishes the broadcaster there, andlistener::create()given the same place hears it from another process; over anipc::unix_socket, one of the same user. The listener can be made before the broadcaster, connects again whenever the connection ends, and tells the broadcaster the topic names it subscribes to; a notification sent before a subscription reaches the broadcaster does not reach it. Values cross as avaluethroughvalue_traits:notify()on a published broadcaster with a type without them stops the program, andsubscribe()on such a listener returnsnotification_errc::type_not_convertible. What happens to the connection is reported onlistener::linkas alink_eventipc::unix_socket, in a new IPC module (<dross/ipc.h>), naming a place where processes meet: a Unix domain socket at a pathA gRPC part,
dross::grpc, built when dross is configured withDROSS_WITH_GRPCon, against gRPC 1.51 or later and protobuf 3.21 or later installed where CMake finds them.ipc::grpc_addressis a place to listen at over gRPC andipc::grpc_targetone to connect to, each with the credentials the user gives, so a broadcaster is published and heard across machines. A port agrpc_addresslistens at is not shared with another server, and a try to connect waits up to 5 seconds. Only dross talks to dross there.find_package(dross COMPONENTS grpc)gives the part and looks for gRPC only thenThe shape of a part that carries messages between processes, in the IPC module:
ipc::message_channel,ipc::message_acceptorandipc::message_connector, which a part implements, withipc::message_channel_eventsandipc::message_acceptor_events, which the library gives it to call. A place satisfiesipc::message_listenable_place_typewhen it can be listened at, andipc::message_connectable_place_typewhen it can be connected to;broadcaster::create()andlistener::create()take a place of any type that does, andipc::unix_socketis one. A part that calls one of those events while another call on it is under way, or after its last call, stops the programipc_errcin the IPC module, for why carrying a message between processes failed:message_too_largefor a message over 64 KiB,queue_overflowfor more than 1 MiB waiting to be sent on a connection,peer_not_same_userfor a peer running as another user, andmessage_cut_shortfor a connection that ends in the middle of a message. All butpeer_not_same_usercan reach a listener in another process as the reason itslink_eventgives for a disconnection; a peer running as another user is never connected tovalue_traits, specialized for a type to say how it becomes avalueand comes back from one, withvalue_convertible_typeto ask whether a type has a conversion andvalue_errcfor why one failed. Conversions are given forvalueand the kinds it holds,bool, integer and floating-point types,std::string, andstd::vector,std::optional, andstd::mapandstd::unordered_mapkeyed bystd::stringobservable, a value its owner thread changes and others are told of.when_changed()calls a function on each change where itsdeliverysays, with the value after the change, or with the values before and after it. Aset()from another thread, directly or through theproxythatmake_proxy()gives, takes effect on the owner’s run loop.get()from a thread that does not own it stops the programnotification::cancel(), which stops every delivery of one notification that has not started, andnotify_options, whosenotify_timing::deferredhas subscribers that chosedirect()run on the sending thread’s run loop oncenotify()has returnedtopic,broadcaster,listenerandnotificationin the notification module. Abroadcastersends typed notifications within the process, and alistenermade from it subscribes to them, each subscriber called where itsdeliverysays. Topics that share a name but carry different types do not reach each other’s subscribers.listener::subscribe()returnsnotification_errc::empty_functionfor an empty functiondeliveryandsubscription, in a new notification module (<dross/notification.h>). Adeliverynames where a subscriber’s function runs:queued()on a run loop,direct()on the sending thread, oron()on one of anoperation_queue’s workers. Asubscriptionis the right to go on being called, ended byreset()or its destructorvalue::get_if<T>(), which reads what avalueholds without copying it: a pointer to the heldT, ornullptrwhen the value holds another type. It cannot be called on a temporaryvalue.as<T>()andvalue_cast<T>()still return a copytimestamp::to_time_point()andtimestamp::duration_since(), which report a time point or a duration thatsystem_clockcannot hold asstd::nullopt
Changed¶
threadandoperation_queueare started withcreate(), which returnsstd::errc::resource_unavailable_try_againwhen the system will not start a thread, instead of lettingstd::system_errorthrough, andstd::errc::not_enough_memorywhen there is no memory to start one. Their constructors that started threads are removed:dross::thread worker;becomesauto worker = dross::thread::create();.operation_queue::create(0)returnsstd::errc::invalid_argumentinstead of throwingstd::invalid_argumenttoml::serializereads the values it writes without copying them. With libstdc++, writing one key holding 1000 numbers takes 30 allocations instead of 7,036timestamp::from_time_point()and thetimestampconstructor from astd::chrono::system_clock::time_pointarenoexcept, as converting atimestampback to a time point isnumberandbooleancan be moved, and moving isnoexcept, as for the other types. Moving one used to copy it, and a moved-from one now holds zero or falsedross/type/array.handdross/type/dictionary.hno longer include<any>. Code that usesstd::anyincludes<any>itself
Fixed¶
Converting a
timestamptostd::chrono::system_clock::time_point, and subtracting onetimestampfrom another, result in the nearer end of the clock wheresystem_clockcannot hold the result, instead of overflowing a signed integer. With libstdc++, which counts nanoseconds, the year 1000 used to convert to 2169. Both arenoexceptdross.pcwrites an absoluteCMAKE_INSTALL_LIBDIRorCMAKE_INSTALL_INCLUDEDIRas it is, instead of appending it to the prefix
0.2.0 - 2026-11-03¶
This release is not ABI compatible with 0.1.x, and the soname changes to
libdross.so.0.2. Rebuild code that links against the library.
Added¶
timestamp::from_time_point(), which reports astd::chrono::system_clock::time_pointoutside the years 0 to 9999 asstd::nullopttimestamp::add()andtimestamp::subtract(), which take astd::chrono::secondsand report a result outside the years 0 to 9999 asstd::nulloptinstead of throwingarray::const_iteratoranddictionary::const_iteratorconvert from theiteratorof the same type, asdata::const_iteratordoesoperation_errc::empty_task, whichoperation_queue::enqueue()reports for an empty taskerrorcompares with astd::error_conditionand with an error condition enum from any library in either order, equal when either category reports them equivalent, asstd::error_codedoes;operator!=is derived fromoperator==errorcarries a detail that says what failed and where: the constructorerror(std::errc, std::string)takes it anddetail()returns it, empty when there is none. Comparisons ignore itnumber::is_floating_point(), true for a number written with a decimal point or an exponent, made from a floating-point type, or computed with a floating-point operand or with a fraction, such as1 / 4. It does not depend on the value, sonumber("1.0")is both floating point and an integer. Comparisons ignore it
Changed¶
dictionary,array,stringandvaluehave move constructors and move assignment operators, where moving used to copy.valuealso takes adictionary,array,stringordataby rvalue reference, in its constructors and its assignment, andarray::appendtakes avalueby rvalue reference. Moving ten entries of a dictionary makes one allocation instead of 31. The source of a move is left usable and empty, or null for avalue, so code that goes on reading what it moved from sees that instead of the old contentsThe difference of two
timestampvalues rounds toward zero as a whole, wheresystem_clockcounts more coarsely than the timestamps. Their seconds and fractions used to round apart. On a clock counting microseconds, 0.9999995 seconds came to one second and now comes to 999,999 microseconds, and 0.0000005 seconds came to one microsecond and now comes to zero, so two different timestamps can have a difference of zerotimestamp,timestamp::date_part,timestamp::time_partandtimezonehold their values directly instead of behind a pointer, so building, copying and moving one allocates nothing, apart from parsing a string. This changes their size and layout, and so the ABIThe
timestampconstructor that takes astd::chrono::system_clock::time_pointresults in the nearer end of the years 0 to 9999 for one outside them, sotime_point::max()does not order before another timestamp. With libc++, whosesystem_clockreaches past those years, it used to give a timestamp whose string did not read back, and adding to it threwThe API page describes the members of
error, which it used to list by name onlytoml::serialize()writes an array whose elements are all dictionaries as an array of tables, with a[[name]]header for each element, instead of inline on one line. An empty array and an array that mixes dictionaries with other values are still written inlineThe
xdgaccessors ignore a relative path in anXDG_*variable, as the XDG Base Directory specification asks, and use the default under the home directory as for an empty one.path::home()ignores a relativeHOMEand falls back to the password database, and returnsstd::nulloptwhen the password database entry is not an absolute path. They used to return such a path as it was, relative to the working directory, and so did the~expansion ofpath::expand()andpath::resolve()timestamp::from_components()and thetimestampconstructors that take the components build the timestamp from its parts, instead of building a default one and replacing each part, so they allocate lesstimestamp’s+and-with a duration throwstd::out_of_rangefor a result whose year, in the timestamp’s own offset, is outside 0 to 9999, the years parsing accepts. They used to return it, and its string did not read back; far enough out the year wrapped and the result compared on the wrong side of where it started. Minutes and hours with more seconds thanstd::chrono::secondsholds throw as well instead of overflowingThe examples in the README, the Sphinx guides and the header comments write
dross::before each name instead ofusing namespace dross;. With glibc,<time.h>declareslong timezoneand<sys/time.h>, which libstdc++’s<thread>includes, declaresstruct timezone, so under the using-directivetimezoneand eventimezone::utc()are ambiguous withdross::timezoneThe C++ examples in the README, the Sphinx guides and the header comments compile after
#include <dross/dross.h>: each writesdross::before the names it uses and declares what else it relies ontimestamp::format()with a format string writes the year of%Yand%Fas the ISO 8601 form does, in at least four digits, so the year 999 is0999. The other conversions are still those ofstd::put_timeerrorcompared with an error code enum equals it only when the category and the value both match, asstd::error_codedoes. Asystem_category()code no longer equals an enum whose code is ingeneric_category(), even when both map to the same conditionerrorcompares withstd::errcand with an error code enum in either order, such asstd::errc::invalid_argument == e.operator!=for these is derived fromoperator==; naming the removed member, such as&error::operator!=forstd::errc, does not compileAn
iteratorofarray,dictionaryordatacompares with aconst_iteratorof the same type in either order, such asa.begin() == a.cend(), and adataiterator also orders against and subtracts from one in either order. The comparisons of every iterator of the three types, and the difference of twodataiterators, are friend functions instead of members, and!=and the ordering operators are derived from==and<=>.dataiterators of the same kind now also compare with<=>, and their difference isnoexcept. Comparisons written with the operators compile as before; naming a removed member, such as&data::const_iterator::operator<, does notdictionary::iteratoranddictionary::const_iteratordeclarestd::input_iterator_tagas theiriterator_category,std::forward_iterator_tagas theiriterator_conceptandvoidas theirpointer, as the standard range adaptors do. They return a pair by value, which the C++17 forward iterator requirements do not allow, and there is no pointer to it. They still modelstd::forward_iteratordictionary::iteratoranddictionary::const_iteratordeclarestd::pair<std::string, value>as theirvalue_type, asstd::flat_mapdoes, instead of the pair of references they return. An element kept throughstd::iter_value_tis a copy that no longer changes with the dictionary or dangles once it is destroyed, and copies can be assigned and swapped, so they can be sorted by key.referenceis still the pair of references, andoperator*is declared to return it. Code that namesvalue_typeto take an element, such asdictionary::iterator::value_type kv = *it;, still compiles but now writes to a copy, not to the dictionary; take it withauto, a structured binding orreferenceto write through it.dictionary.hincludesvalue.h, sincevalue_typeholds avalueerror::message()returns the message of the code followed by": "and the detail when the error has one, such asInvalid argument: line 2, column 3: Expected '='. Without a detail it returns the message of the code as beforeWriting an
errorto a stream with<<adds": "and the detail afterdomain:codewhen the error has one, such asgeneric:22: line 2, column 3: Expected '='. Without a detail it writesdomain:codeas beforeerror’s<=>returnsstd::weak_orderinginstead ofstd::strong_ordering, since errors that differ only in their detail compare equivalent but can be told apart.a < band(a <=> b) == 0compile as before; code that stores the result in astd::strong_orderingdoes notnumber’s<=>andcompare()returnstd::weak_orderinginstead ofstd::strong_ordering, sincenumber("1.0")andnumber(1)compare equivalent but only the first is floating point.a < band(a <=> b) == 0compile as before; code that stores the result in astd::strong_orderingdoes not
Fixed¶
timestampno longer overflows a signed integer wheresystem_clockcounts nanoseconds, near its ends: building one from a time point within a second oftime_point::min(), converting one back, or taking a difference whose seconds alone do not fit in the durationtoml::deserialize()reads an array of tables, written with[[name]]headers, as anarrayofdictionaryvalues. Each header appends a table, and the headers and pairs after it fill that last table. A[[name]]header fails withTable defined twicewhennameis a table defined in another way, and withTable header names a key that is not a tablewhen a key/value pair setname. Reading used to fail withArrays of tables are not supportedtoml::deserialize()reads a datetime with an offset, such as1979-05-27T07:32:00Zor1979-05-27 00:32:00.5-07:00, as atimestampthat keeps the offset, andtoml::serialize()writes atimestampback in that form. A local date-time, a local date and a local time fail withtimestamp cannot hold a datetime without an offset, since atimestampalways has an offset. Reading used to fail withExpected a newlineorLeading zero in a number, and writing withUnsupported value type for TOML serializationtoml::deserialize()fails on the floatsinfandnan, with or without a sign, with the detailnumber has no infinity and keeps nan for errors. It used to sayInvalid value formatorInvalid number formattoml::deserialize()reads underscores between the digits of a number, such as1_000,3.14_15,1e1_0and0xDEAD_beef, and rejects one without a digit on each side.toml::serialize()writes the number back without them. They used to fail withExpected a newlinetoml::deserialize()reads integers in hexadecimal, octal and binary, such as0xff,0o755and0b1010, andtoml::serialize()writes them back in decimal. They used to fail withExpected a newlinetoml::deserialize()reads multi-line strings, between"""or''', keeping each newline as it is written.toml::serialize()writes the text back as a basic string. They used to fail withExpected a newlineorInvalid value formattoml::deserialize()reads literal strings, such as'C:\Users', as values and as keys.toml::serialize()writes the text back as a basic string. They used to fail withInvalid value formatorInvalid key formattoml::deserialize()reads dotted keys, such asa.b = 1, at the top level, under a table header and in an inline table, and rejects one that would add to a table a header or an inline table defined, as TOML v1.0.0 says. They used to fail withExpected '='toml::serialize()writes a float whose value is integral with.0, sox = 1.0andx = 1e2read and written back arex = 1.0andx = 100.0. They used to be written as the integersx = 1andx = 100, which read back as integerstoml::deserialize()rejects a number with a leading zero, such as01or-01, or without a digit on both sides of the decimal point, such as1.or-.5, and a newline or a comment before a comma or the closing brace of an inline table. It used to read themtoml::deserialize()no longer slows down with the square of the number of table headers under one parent. Each header copied the tables that earlier headers had put under the same parent, so 2000 headers such as[servers.sN]took about 25 seconds in a Debug build, against 0.2 seconds nowtoml::deserialize()andtoml::serialize()report why they failed in the detail of the error. A parse error names a line and a column, counted in bytes, and what was wrong: for a key or table defined twice, where its key/value pair or table header starts, and otherwise where reading stopped. They used to build the message and drop it, so every parse error readInvalid argumenterrordeclares its copy and move operations, so assigning one compiles under GCC with-Wextra -Werror, and moving one no longer copies it. The assignment the compiler declared was deprecated becauseerrorhas its own copy constructor, which also kept the compiler from declaring the moveserrorcompared withstd::errcasks both categories throughequivalent(), asstd::error_codedoes, so a code whose category maps it to that condition only inequivalent()equals itoperation_queue::enqueue()refuses an emptystd::functionor a null function pointer with the newoperation_errc::empty_task, assubmit()refuses them by returningfalse. It used to queue the task, and the process ended once a worker ran itpath::home()reads the password database withgetpwuid_r()into a buffer of its own. It usedgetpwuid(), whose entry is shared by the whole process, so a call on one thread, directly or through thexdgaccessors, could overwrite an entry that another thread had taken fromgetpwuid()
0.1.1 - 2026-10-24¶
Fixed¶
toml::deserialize()rejects input that is not valid UTF-8 withstd::errc::invalid_argument, andtoml::serialize()fails withstd::errc::operation_not_supportedon a string or key that is not valid UTF-8toml::deserialize()rejects a control character other than tab withstd::errc::invalid_argument, as TOML requires, instead of keeping it in a string, a quoted key or a comment or skipping it as whitespace. A CR is accepted only as part of a CRLF line endingtoml::deserialize()reads the\band\fescapes in a quoted key as it does in a string, so a key thattoml::serialize()wrote with them reads backtoml::deserialize()reads the\uXXXXand\UXXXXXXXXescapes in strings and quoted keys, and rejects one that does not name a Unicode scalar value withstd::errc::invalid_argumenttoml::serialize()writes a control character that has no short escape as\u00XXinstead of as it is, so the output is valid TOML andtoml::deserialize()reads it backtoml::serialize()fails withstd::errc::operation_not_supportedon a NaN number instead of writingNaN, which is not a TOML valuetoml::serialize()writes an integral value outside the 64-bit range of TOML integers as a float (9223372036854775808.0) instead of as an integer that TOML readers must refusetoml::deserialize(),toml::serialize()and constructing anumberfrom a string classify key and number characters by ASCII ranges instead of with<cctype>. A byte from 0x80 up reached those functions as a negative value wherecharis signed, which is undefined behaviour, and under a single-byte locale such as ISO-8859-1 a UTF-8 key whose bytes that locale counts as letters, such as U+00EA, was read as a bare key and written without quotes, both invalid TOMLtoml::serialize()writes an empty key as""instead of as an empty bare key, sotoml::deserialize()reads it backtoml::deserialize()reads a bare key that starts with a digit or a hyphen, such as1234 = 1or[-x], whichtoml::serialize()writes baretoml::deserialize()rejects a key/value pair or a table header that is followed on the same line by anything other than a comment, such asa = 1 b = 2or[a] b = 1, withstd::errc::invalid_argumenttoml::deserialize()reads an array with a comma after the last value, such as[1, 2,]toml::deserialize()reads a float with an exponent, such as1e20or6.626e-34toml::deserialize()rejects a number thatnumbercannot hold, such as1e5000or-., withstd::errc::invalid_argumentinstead of reading it as NaNtoml::deserialize()rejects a key or table defined twice, such asx = 1followed byx = 2or a[t]header aftert = 1, withstd::errc::invalid_argumentinstead of keeping only the last definitiontoml::deserialize()keeps tablea.bwhen a[a]header follows a[a.b]header, instead of replacing tableatoml::deserialize()rejects a[[name]]array of tables header withstd::errc::invalid_argumentinstead of reading it as a[name]table that keeps only the last table of the arraypath::home()and thexdgaccessors treat an emptyHOMEorXDG_*variable as unset, andpath::home()returnsstd::nulloptwhen the password database entry has an empty home directorypath::expand()andpath::resolve()expand only~alone or a leading~/. A path such as~backup.txtor~user/xis no longer joined to the current user’s home directory:expand()returns it unchanged andresolve()resolves it against the working directory
0.1.0 - 2026-10-04¶
Added¶
timestampclass for date and time handling with timezone supporttimezoneclass with type-safe timezone representation and ISO 8601 supportModern C++23 chrono integration for timezone offsets
Optional error handling for timezone parsing (
from_stringreturnsstd::optional)Compositional design with
date_partandtime_partnested classesInitial documentation system with Sphinx + Breathe
GitHub Actions workflow for automatic documentation deployment
Comprehensive API reference documentation
User guide with examples and best practices
Changed¶
Improved timezone API:
offset()returnsstd::chrono::minutesinstead of intEnhanced error handling:
timezone::from_string()returnsstd::optional<timezone>Simplified API: removed redundant timezone methods (
is_local(),has_offset())Updated documentation to reflect timestamp and timezone APIs
path::mkdir()now succeeds when the target directory already exists instead of reporting it as a failure with a zerocode(); it fails only when the underlying filesystem operation reports an actual errorpath::expand()now reports canonicalisation failures on a~path through itsstd::expectedreturn value instead of letting astd::filesystem::filesystem_errorescapefind_package(dross <version>)now requires the same minor version while the major version is 0, where it previously accepted any 0.x. A consumer asking for0.1, or for0, no longer matches an installed0.9; it has to ask for the minor it was built againstThe soname carries the minor version while the major version is 0:
libdross.so.0.1rather thanlibdross.so.0. A program linked against one 0.x no longer loads another 0.x at run time. From 1.0 the soname carries the major version alone