Doug Gregor

3.5K Followers
166 Following
1.9K Posts
Dad, husband, Swift language designer and Swift/C++/ObjC compiler implementor, Author, Generic Programming aficionado. He/him.
GitHubhttps://github.com/DougGregor
Oh no! The six dots was my most amusing contribution to the C++ standard, and now it’s going away. https://www.sandordargo.com/blog/2026/03/11/cpp26-oxford-variadic-comma
C++26: The Oxford variadic comma

C++26 brings us a small but meaningful cleanup to the language: deprecating ellipsis parameters without a preceding comma. This change, proposed in P3176R1, aims to improve C compatibility, reduce confusion, and pave the way for future language features. The proposal’s name is a playful reference to the Oxford comma - that final comma before “and” in a list. Just as the Oxford comma clarifies lists in English, this proposal mandates a comma before the ellipsis in function parameters. The problem First, let’s clarify terminology. This proposal is about ellipsis parameters - the C-style variadic parameters you might know from printf. These are different from template parameter packs, even though both use the ... syntax. Currently, C++ allows two ways to declare an ellipsis parameter: 1 2 void foo(int, ...); // with comma (C-compatible) void foo(int...); // without comma (C++-only) The second form without the comma originates from early (pre-standard) C++ function prototypes, but has remained part of standardized C++ ever since. Interestingly, C has never allowed the comma to be omitted. The C standard, unchanged since C89, requires: 1 2 // In C, only this form is valid: int printf(char*, ...); C++ later added support for the comma-separated form for C compatibility, but kept the old syntax for backwards compatibility. This creates an awkward situation where (int, ...) is compatible with both languages, but (int...) only works in C++. Why is this confusing? The real confusion comes from template parameter packs, introduced in C++11. Consider this example: 1 2 template<class Ts> void f(Ts...); // well-formed: a parameter of type Ts followed by an ellipsis parameter Many users associate (T...) with a parameter pack, not with an ellipsis parameter. Instead, it’s a single parameter of type Ts followed by an ellipsis parameter! To actually declare a parameter pack, you need: 1 2 template<class... Ts> void f(Ts... args); // args is a parameter pack The situation gets even more confusing with abbreviated function templates: 1 2 3 4 5 // abbreviated variadic function template void g(auto... args); // abbreviated non-variadic function template with ellipsis parameter void g(auto args...); These two look similar but have completely different meanings. The latter should be deprecated. The curious case of six dots Perhaps the most bizarre syntax enabled by the current rules is this: 1 void h(auto......); // equivalent to (auto..., ...) Yes, that’s six consecutive dots - if I counted it right. This declares a function template parameter pack followed by an ellipsis parameter. While technically possible to use (if the pack belongs to a surrounding class template), the syntax strongly suggests all dots apply to auto, which is misleading. What’s being deprecated? C++26 will deprecate ellipsis parameters without a preceding comma. Specifically: 1 2 3 4 5 6 7 8 9 // Deprecated in C++26: void f(int...); void g(auto args...); template<class T> void h(T...); // T is not a parameter pack // Preferred (and C-compatible): void f(int, ...); void g(auto args, ...); template<class T> void h(T, ...); The standalone ellipsis parameter remains valid: 1 void f(...); // still valid, C-compatible, unambiguous Impact This is a pure deprecation - removal had been already refused before. No existing code becomes ill-formed. Any deprecated uses can be mechanically transformed by adding a comma before the ellipsis. This transformation is simple enough to be automated by tooling. The proposal doesn’t estimate how much code will be affected, though the author found several dozen occurrences of the T...... pattern in a GitHub code search. The real number of affected declarations is likely non-trivial, finding them requires semantic analysis since (T...) could be either an ellipsis parameter or a parameter pack depending on context. This deprecation clears the path for future language features. The syntax (int...) has already blocked proposals like P1219R2 “Homogeneous variadic function parameters”, which would have given this syntax a new meaning. By deprecating the comma-less form, the committee preserves design space for future evolution while improving consistency with C and reducing a common source of confusion. Conclusion The Oxford variadic comma is a small change with multiple benefits: better C compatibility, reduced confusion with parameter packs, and preserved design space for future features. While the title is playful, the motivation is serious - cleaning up a historical artifact that serves little purpose in modern C++. If you’re using ellipsis parameters, start adding that comma before the .... Your code will be more C-compatible, less confusing, and ready for whatever comes next. Connect deeper If you liked this article, please hit on the like button, subscribe to my newsletter and let’s connect on Twitter!

Sandor Dargo’s Blog
I'm hiring to the WebKit Privacy & Adtech team at Apple! We're looking for an engineer who can help us investigate online tracking and fingerprinting, scale up crawling to detect tracking and fingerprinting in an automated fashion, and design and implement privacy-preserving alternatives to tracking for use in online advertising. It's systems programming in C++ and Swift and the team is local to Cupertino. Please retoot so that people looking for a new job can see this. 🙏🏼 https://jobs.apple.com/en-us/details/200651137-3401/webkit-privacy-adtech-engineer
WebKit Privacy & Adtech Engineer - Jobs - Careers at Apple

Apply for a WebKit Privacy & Adtech Engineer job at Apple. Read about the role and find out if it’s right for you.

🇮🇪 Join us at EuroLLVM 2026 in Dublin, April 13–15

Early bird registration ends this Friday, March 13. If you’re working on compilers, toolchains, security, or AI infrastructure, this is an amazing event to connect with the global LLVM community!

https://llvm.swoogo.com/2026eurollvm/

2026 European LLVM Developers' Meeting

The Onion simply doesn’t miss.
Swift at scale: building the TelemetryDeck analytics service

TelemetryDeck is an app analytics service specifically for developers, designed to manage usage analytics that are anonymized, privacy-focused, and really easy to use. TelemetryDeck is managing the data of over 16 million people every month, helping thousands of app publishers improve their products, and we’re doing it all with a Swift-based infrastructure.

Swift.org
On a whim, decided to donate $500 to the Trevor Project (https://www.thetrevorproject.org), because LGBTQ+ folks are under attack in the U.S., and young people are hugely affected by it. They have some other donors doing a 3:1 match for a few more hours, and my employer will do 2:1 as well.
Support Homepage

The Trevor Project is a non-profit suicide prevention organization that provides 24/7 crisis support services, research, and advocacy for LGBTQ+ young people.

The Trevor Project
If you work at the same place I do, today’s the last day for the 2:1 matching on charitable contributions with the maximum doubled. I usually do the annual donations to various groups in the fall, but to leverage this 2:1 match I’ve been leaving a comment with the donations to consider it part of the 2026-27 donation cycle. Nonprofits are generally happy to do so. If you’re in a position to do the same, please do. Think of it as a way to get your employer to support the causes you care about.
Oh look, the Party of Epstein has introduced the “Stop the Sexualization of Children Act”. Of course it’s not at all
about helping children m, it’s a nationwide LGBTQ+ book ban, starting with schools. Please take a moment to tell your Representative to oppose HR 7661. https://www.congress.gov/bill/119th-congress/house-bill/7661/text
Text - H.R.7661 - 119th Congress (2025-2026): Stop the Sexualization of Children Act

Text for H.R.7661 - 119th Congress (2025-2026): Stop the Sexualization of Children Act

🚀 New libraries for @graphql on Vapor and Hummingbird dropped!

Expose GraphQL APIs with just one line of code:
routeBuilder.graphql(schema: schema) { ... }

✅ Full spec compliance
✅ WebSocket subscriptions
✅ Built-in GraphiQL IDE

Check them out 👇
https://forums.swift.org/t/introducing-graphql-vapor-hummingbird-packages/84758

Introducing GraphQL Vapor & Hummingbird Packages

The GraphQLSwift organization is excited to publicly release graphql-vapor and graphql-hummingbird, which simplify exposing GraphQL APIs through the Vapor and Hummingbird server frameworks. Correctly exposing a GraphQL schema through HTTP is not trivial; you must consider specialized encodings, match errors to response status codes, and integrate specialized subscription protocols. The new graphql-hummingbirdand graphql-vapor packages handle all of these details. Integration is as easy as calli...

Swift Forums

We’re hiring compiler and tools engineers to push the boundaries of static analysis and language design. If you’re passionate about security, memory safety and working on tools that eliminate entire classes of bugs, come build breakthroughs in software security with us!

https://jobs.apple.com/en-us/details/200642941-0836/compiler-security-engineer-c-c?team=SFTWR

https://jobs.apple.com/en-us/details/200641781-3337/security-developer-tools-engineer-static-analysis?team=SFTWR

Compiler Security Engineer - C/C++ - Jobs - Careers at Apple

Apply for a Compiler Security Engineer - C/C++ job at Apple. Read about the role and find out if it’s right for you.