Data members that want to use size()

The following snippet doesn’t compile:

struct A {
  static constexpr size_t size() { return 42; }
  int data_[size()];
};

The problem is that the size (and therefore the type) of data member data_ can’t be computed until we know the value of size(); but evaluating size() requires A to be complete ([class.mem.general]), which won’t happen until the closing brace on the next line.

One workaround, obviously, is to repeat the magic number 42 in two places. That’s probably the simplest option; but here are a few other workarounds.

Read More

Colourfields

Over on the (inexplicably login-walled) site “NewEnigma,” Keith Austin writes:

Draw a 4-by-4 grid. Colour each square red or blue. Select any square, S, and write 1 in it. Then write 1 in every square you can reach from S by a series of moves, where each move is from a square to an adjacent, horizontally, vertically, or diagonally, square of the same colour […]

In brief: What is the maximum number of queenwise-connected monochromatic regions you can make by coloring each square of an \(n\times n\) grid either red or blue?

Read More

Kinton Ford’s Canto I

In “Varaldo’s Shahrazad and Chiti’s Centunesimo Canto (2025-08-11) I mentioned the existence of a lipogrammatic translation of Canto I of Dante’s Inferno performed by one Kinton Ford (a pseudonym, as far as I know) for Rick Whitaker’s now-defunct literary e-zine Exquisite Pandemic (2020–2021). A year later, seeing it’s still unavailable anywhere else online, I feel justified in preserving that whole tour-de-force here for posterity.

Read More

A crosswording miscellany

I just finished reading Natan Last’s 2025 book Across the Universe: The Past, Present, and Future of the Crossword Puzzle. It was… fatiguing. Now, I myself am a “discursive” writer, so I’m throwing stones from a glass house here; but it seemed to me that Last’s every paragraph consisted of three or four anecdotes halfway told, capped off with some nonsensical simile. Open the book at random to page 31:

On December 11, 2022, Eric [Albert] suffered a hemorrhagic stroke of his cerebellum. He’s lucky to be alive: around 50 percent of patients die in a month, half of those within the first two days. When we first spoke in April 2023, I immediately asked if his language had been affected, then regretted it. But he was fine, he said. The neurologists don’t know why the stroke happened, or how he recovered his cognition so quickly. He says he repeated the French he was learning to himself in the ICU. I imagined him, was almost ashamed to imagine him, saying ciré ciré ciré, épée épée épée — as if the accent marks were stray neurons in need of repair — or an item from James Joyce’s Finnegans Wake I’d just seen in Word Ways because it’s the only “word” with five or more Q’s: Quoiquoiquoiquoiquoiquoiquoiq! In Joyce’s Wake, it’s preceded by the line: “He lifts the lifewand and the dumb speak.” I remembered analyses of Broca’s aphasia I’d read studying neuroscience in college […]

Read More

Interconverting std::function with copyable_function

C++11 introduced std::function as a type-erased callable-object holder. function was badly designed in a few ways: Its rarely used “go fish” API bloats every user; it advertises operator() const even when the controlled object’s operator() is mutating; it handles what should be a precondition violation by throwing an exception, which again bloats every user and means its operator() can never be noexcept. So C++26 fixed these problems by adding std::copyable_function. (Which preserves some of function’s suboptimal design decisions: copyable_function<bool()> remains implicitly convertible to copyable_function<void()>, contextually convertible to bool, and assignable from nullptr.)

Read More

Egerton MS 1995

Previously on this blog: “The Book of St Albans (1486)” (2026-05-22), in which I made a table of terms of venery, a.k.a. company terms, e.g. “an exaltation of larks,” as in the eponymous book by James Lipton. I mentioned that the Book of St Albans actually has “an exaltyng of larkis,” and that it’s only in Egerton MS 1995 (circa 1450), according to Lipton, that we find “an exaltacyon of larkys” proper. But I couldn’t find any digitized copy of Egerton MS 1995 to verify that claim.

Read More

Some recent discoveries

First images of PHerc. 1667. When Vesuvius buried Herculaneum, it turned many papyrus scrolls in the Villa dei Papiri to burnt hunks of carbon without destroying their physical structure. Since the 2010s (or earlier?), people have tried to non-invasively image what remains of the scrolls. In June 2026, the latest “Vesuvius Challenge” prize was awarded to a team who successfully imaged the first “complete” scroll. The team’s report (“Complete virtual unwrapping and reading of a rolled Herculaneum papyrus”, Angelotti et al., 2026) points out that the scroll is even less “complete” than it used to be: invasive efforts in the late 20th century had already reduced it from about 14 grams of carbonized gunk to about 6 grams. The group’s full transcription consists of only 300 to 400 complete words. They identify PHerc. 1667 as some sort of philosophical treatise — unsurprising, as many of the scrolls that could already be deciphered turned out to be works of Philodemus. Contrary to some media reports, the title of PHerc. 1667’s work is unknown; but a separate finding reported in the same paper identifies PHerc. 139 as book 8 of Philodemus’s On gods (περὶ θεῶν, book Η).

Read More

The Book of St Albans (1486)

This week I read James Lipton’s An Exaltation of Larks; or, The Venereal Game (2nd edition, 1977), a discursive collection and celebration of “terms of venery” — the collective nouns like “school of fish” and “pride of lions” that were (so the story goes) mostly invented by medieval hunters who wanted to have their own proper jargon to distinguish the real hunters from the dilettantes.

Read More

ELF’s ways to combine potentially non-unique objects

Previously I wrote:

[Template parameter objects of array type] are permitted to overlap or be coalesced, just like initializer_lists and string literals. Clang trunk isn’t smart enough to coalesce potentially non-unique objects [but] GCC, once it implements define_static_array, will presumably make them the same.

Well, GCC 16 has an experimental implementation of define_static_array (compile with g++ -std=c++26 -freflection), and it does not coalesce template parameter objects of array type in the way I expected. Digging deeper into why not, I learned that there are at least three ways compilers and linkers (on ELF — that is, non-Windows — platforms) conspire to “merge” potentially non-unique objects:

  • Merging at the compiler level (for initializer_list backing arrays)
  • Sections with SHF_MERGE (for string literals and backing arrays)
  • Sections with SHF_GROUP, a.k.a. COMDAT sections (for inline variables)
Read More