Sign in

Eric Niebler

@ericniebler.com
1.2K followers 85 following 246 posts

Distinguished C++ nerd at @nvidia, father, @isocpp member, former nomad, and sometimes artist wannabe. opinions are my own he/him

PostsRepliesMedia
Eric Niebler @ericniebler.com · 23/08/2026
Portable-ish code for getting the pretty name of a type godbolt.org/z/Y5zqxbvP1 #cpp
Screenshot of C++ code with a compile-time assertion that nameof<int> == "int"
040
Eric Niebler @ericniebler.com · 23/08/2026
I finally got `import std` to work on @compiler-explorer.com godbolt.org/z/3P5b11f5M #cpp
screenshot of Compiler Explorer compiling a C++ program that does `import std`
1162
Eric Niebler @ericniebler.com · 23/08/2026
The proposal (wg21.link/p3019) makes a bunch of references to the small-buffer optimization, like
Drafting note: The above is intended to permit a small-buffer-optimization and handle the case where allocators
compare equal but we do not want to swap pointers.
100
Eric Niebler @ericniebler.com · 12/08/2026
Jeff Bridges as The Dude from The Big Lebowski saying, "I hate the fucking Eagles, man."
020
Eric Niebler @ericniebler.com · 14/05/2026
000
Eric Niebler @ericniebler.com · 09/01/2026
I have my own version of std::conditional_t, implemented to instantiate fewer class templates (attached). The weird thing is, I have encountered scenarios where my conditional_t picks the wrong branch, whereas std::conditional_t picks the right one. This baffles me. Am I crazy?
An implementation of std::conditional_t that only instantiates two class templates.
231
Eric Niebler @ericniebler.com · 24/12/2025
No Advent of Code for me. Instead, I've used the break to write the type-erasure library I have always wanted. C++ doesn't make it easy to have both dynamic polymorphism *and* value semantics, but this little utility does! Interfaces can extend other interfaces, and it works in consteval, too. 🤩
a screenshot of an editor showing a snippet of code that defines an interface, and a type that models the interface non-intrusively, and a type named `any` that is parameterized on the interface and that stores the model while erasing its type.
4196
Eric Niebler @ericniebler.com · 02/11/2025
Also
Mr Incredible and his boss
140
Eric Niebler @ericniebler.com · 02/11/2025
000
Eric Niebler @ericniebler.com · 31/10/2025
Film poster for Short Circuit (1986)
040
Eric Niebler @ericniebler.com · 23/10/2025
Twiki and Dr Theopolis from Buck Rogers
010
Eric Niebler @ericniebler.com · 22/10/2025
Crazy theory meme
150
Eric Niebler @ericniebler.com · 29/08/2025
I've started using digit separators when checking the value of __cplusplus and feature test macros, and i am liking it. 2019'02 is less work for my old brain.
screenshot of c++ source code
2192
Eric Niebler @ericniebler.com · 07/04/2025
The Lone Gunmen from the X-Files
020
Eric Niebler @ericniebler.com · 28/03/2025
Seattle is upping its crime game. 🫠
Headline: Report of Man With Bazooka in downtown Seattle
000
Eric Niebler @ericniebler.com · 19/03/2025
Black and white photo of Jim Henson in full beard.
020
Eric Niebler @ericniebler.com · 08/03/2025
Have a happy C++!
two heavy plus signs over a U looks like a smiling emoticon, but rotated 90 degrees clockwise looks like C++
0213
Eric Niebler @ericniebler.com · 06/03/2025
Boy that sends me back
Headline: Dysentery Outbreak in Oregon Sickens 40
030
Eric Niebler @ericniebler.com · 24/02/2025
C++ wizards: this one has me stumped. I can initialize an immovable sub-object if it is a member but not if it is a base class. Why? godbolt.org/z/P7jxr5joK #c++ #cpp
450
Eric Niebler @ericniebler.com · 16/02/2025
I miss ThinkGeek. Where do I go to buy desktop refrigerators and TaunTaun sleeping bags now?
ThinkGeek monkey logo
050
Eric Niebler @ericniebler.com · 07/02/2025
Worried about the price of eggs? Get some hens. 🐔 Srsly.
Eggs over easy on English muffin. Egg yolks are a deep orangy yellow.
010
Eric Niebler @ericniebler.com · 03/02/2025
Seattle's master criminals have struck again
Headline: "Two Donkeys Named Juan and Julio Stolen"
000
Eric Niebler @ericniebler.com · 02/02/2025
Use [[no_unique_address]] to determine if a set of types are unique in O(N). godbolt.org/z/dTcGhqseo
a screenshot of some syntax-highlighted C++ code showing how the [[no_unique_address]] attribute can be used to determine if a set of types are unique.
370
Eric Niebler @ericniebler.com · 10/01/2025
I'm embarrassingly excited about what constexpr exceptions can do to improve the compile-time diagnostics of Senders.
Introduction
The hardest part of writing a sender algorithm is often the computation of its completion signatures, an intricate meta-programming task. Using sender algorithms incorrectly leads to large, incomprehensible errors deep within the completion-signatures meta-program. What is needed is a way to propagate type errors automatically to the API boundary where they can be reported concisely, much the way exceptions do for runtime errors.

Support for exceptions during constant-evaluation was recently accepted into the Working Draft for C++26. We can take advantage of this powerful new feature to easily propagate type errors during the computation of a sender’s completion signatures. This significantly improves the diagnostics users are likely to encounter while also simplifying the job of writing new sender algorithms.
3223
Eric Niebler @ericniebler.com · 07/01/2025
Huh
Snap dialog that reads: Visual Studio Code will quit and update in -1064531426 minutes.
480
Eric Niebler @ericniebler.com · 19/12/2024
is there any way at all to suppress this warning on gcc-10? godbolt.org/z/c1Tsd4Pvs and if you are about to reply "why are you writing code like that?" just stop right there. i have reasons.
350
Eric Niebler @ericniebler.com · 04/12/2024
Go to Seattle. Do crimes.
Home intruder stole remote, dropped it before fleeing.
020
Eric Niebler @ericniebler.com · 30/11/2024
Just when you think you understand C++ templates... I'm a little surprised that I can't SFINAE on the evil "pack expansion into non-pack parameter" error. Is there a way to change the implementation of `call` or `callable` to get the following code to compile? godbolt.org/z/Pj9G11sr3
a screenshot of some C++ code trying to detect whether a meta-callable is callable with a set of arguments.
480
Eric Niebler @ericniebler.com · 23/11/2024
Windows dev #1: #define interface struct Windows dev #2:
Ren of Ren & Stimpy giving the thumbs up
150
Eric Niebler @ericniebler.com · 22/11/2024
I'll see you and raise
080
Eric Niebler @ericniebler.com · 15/11/2024
When I started programming, PC gaming looked like this.
Green monochrome screen with intro to Zork on screen
0180
Eric Niebler @ericniebler.com · 13/11/2024
i hadn't quite realized that, within a class template, nested types are not instantiated until they are actually used. in other words, the following actually compiles.
3160
Eric Niebler @ericniebler.com · 10/11/2024
I found an implementation of `std::declval` that compiles 2x faster than the "standard" one[*]. Rather than overload resolution and SFINAE, this one uses a variable template and a partial specialization: [*]: tested w/ clang-17
the source code of a novel implementation of std::declvala chart of a compile-time benchmark of the new implementation vs. the old
1101
Eric Niebler @ericniebler.com · 22/10/2023
A c++ haiku
it's not ADL
there's no way it's ADL
it was ODR
040
Eric Niebler @ericniebler.com · 20/09/2023
It's better with concepts tho: godbolt.org/z/sYcobvrEM
010
Eric Niebler @ericniebler.com · 25/05/2023
Pondering this gem from the Itanium ABI : Recommendation for new platforms: consider forbidding the use of function templates on your platform so that the ABI can remove these expression-mangling rules. I'm sorry, say what now? itanium-cxx-abi.github.io/cxx-abi/a…
010