People frequently ask how to do things like this in C++20: Make a concept Renderer that is satisfied if and only if t.render(u) is valid for all Printable types U. (From /r/cpp.) Make a concept ValidSize that is satisfied if and only if t is convertible to some integral type U. (From the standard.)…
2025
Someone on StackOverflow just asked about the silly-looking requires requires syntax that’s used a few times in the C++2a Working Draft and in the Ranges library implementation. Since I had just written slides on this for my presentation at the NYC C++ meetup last week, and my explanation seemed…
Here’s a slogan that needs more currency: const is a contract. Let’s start off with the one place this is not true: variable declarations. Here y is an object of const type. This means that it’s constant, immutable; nobody can change its value, and its value cannot change. This is what newcomers to…
In my C++ training classes, I often explain the meaning of =delete as The library author is saying, “I know what you’re trying to do, and what you’re trying to do is wrong.” In some situations there’s not much difference between =delete’ing a function and not-=delete’ing it. In fact, the most common…
니체, 사르트르에 이어 '어떤 삶을 살고 싶은가?'에 대한 고민을 조금 더 이어 나가고 싶었다. 한 명의 철학자를 고르기보단 여러 철학자의 이야기를 공부했는데, 그 중 인상 깊었던 한나 그랜트의 철학 중 일부를 정리해 보려고 한다. 아렌트는 인간이 인생을 살아가면서 하는 활동을 노동, 작업, 행위 세 가지로 구분 지었다. 그리고 그 중 '행위'라는 활동이 인간다운 삶을 살아가는 데 있어서 가장 중요한 활동이라고 한다. 보통 노동이라고 하면 지루하고 반복적인 일이라는 뉘앙스를 준다. 아렌트는 생존을 위한 활동을 '노동'이라고…
C++20 introduces new library functions std::erase and std::erase_if. Notice that I said “functions,” not “algorithms”: these are not implemented as generic function templates, but rather as a closed set of function overloads, scattered across the STL’s many container-related headers. There’s a…
Here’s another slogan that needs more currency: Value category is not lifetime. What I mean by this mantra is probably best shown by example. Two examples of a common C++ problem Suppose we design a String class that looks like this: And suppose we design a TokenIterator class that looks like this:…
I was all set to write a blog post about hidden friends, and then I realized that it was turning into a blog post largely ranting about ADL. So I figure I should rant about ADL first, and then talk about hidden friends in Part 2. First things first. ADL stands for “argument-dependent [name] lookup.”…
This blog post has now been more than a year in the making; it’s the one for which I was laying the groundwork when I wrote “What is ADL?” (2019-04-26). Since I used the term again the other day, let’s finally define it: What is the std::swap two-step? The name “std::swap two-step” comes (as far as…
Recall that in C++ there’s a difference between a using-declaration and a using-directive. Using-declarations A using-declaration is semantically similar to a declaration; it introduces into the current scope a new meaning for a name. If that name already had one or more meanings from outer scopes,…
I just watched Odin Holmes’s half-session from C++Now 2017 titled “Type-Based Template Metaprogramming is Not Dead.” Honestly, I found it mostly pretty hard to follow. (Note to presenters: The video recording will pick up your mouse cursor, but not your laser pointer!) But there was one “oooh”…
Thanks to Jeff Trull for this example of metaprogramming. Our goal is to make a filter metafunction that takes a typelist and returns a new typelist with all non-matching elements filtered out. Here’s our unit test: And here’s our original metaprogram (courtesy of Jeff). Most C++11 metaprograms, in…
C++2a concepts (formerly known as “Concepts Lite” and/or the Concepts TS) famously do not support “definition checking.” The idea of definition checking is that the programmer might write and then an algorithm such as Now, in C++2a–concepts-land, where templates are still effectively duck-typed, we…
I’m fascinated with the early 20th-century zeal for electrifying everyday things. Hand tools, toasters, hot combs—they all obviously benefited from the jolt of electrification. But the eraser? What was so problematic about the humble eraser that it needed electrifying? A number of things, it turned…
Click on the image to see it in detail, or scroll down to see it broken down into 3 parts. The first cell, and you Some time roughly 4 billion years ago, while the Earth was young enough that club bouncers still asked it for ID, something very very strange happened. A random mixture of lifeless…
Netflix Technology Blog 12 min read· Mar 31, 2025 -- The journey from script to screen is full of challenges in the ever-evolving world of film and television. The industry has always innovated, and over the last decade, it started moving towards cloud-based workflows. However, unlocking cloud…
This royally named double passage can be found in posh Mayfair and is the sort of place where the first dozen pages in Google are full of estate agent adverts for expensive houses. This part of London was first being laid out with a grid of streets in the 1740s, but it seems likely that Rex Place…
This post describes how to compile a single C++ source file to an object file with the Clang API. Here is the code. It behaves like a simplified clang executable that handles -c and -S. 1 cat > main.cc <<eof 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34…
What It Means Penchant refers to a strong liking for something, or a strong tendency to behave in a certain way. It is usually used with for. // My penchant for mathematics helped me become an engineer. See the entry > penchant in Context "Sly Lives! is exceptionally strong in its attention to…
컨테이너 이미지의 빌드 및 배포에 관한 성능을 개선하기 위해 리서치를 하다보니, 혼자 알기에 너무 재밌는 배경들이 많아서 정리해 보기로 했다.오늘은 컨테이너와 이미지의 구조 및 원리(특히 파일 시스템과 관련한 부분), 관련 컴포넌트들을 딥다이브하여 파헤쳐 보고, 오픈소스 생태계에서 이들을 활용하기 위해 어떤 움직임들을 보였는지 살펴보는 시간을 가져볼까 한다. 컨테이너 컨테이너 이미지가 뭔지 알려면 먼저 컨테이너에 대해서 알아야 한다. 흔히 컨테이너를 이야기 하면 도커를 엮어서 생각하는데, 사실 도커는 단일 기술이 아니다. 컨테이너의…
한나와 그 자매들 원제 : Hannah and her sisters 1986년 미국영화 각본, 감독 : 우디 앨런 출연 : 미아 패로우, 마이클 케인, 우디 앨런 바바라 허쉬, 다이앤 위스트, 모린 오설리반 캐리 피셔, 막스 본 시도우, 로이드 놀란 다니엘 스턴, 존 터투로 1966년 '타이거 릴리에게 무슨 일이?'로 감독 데뷔한 우디 앨런은 두 번의 전환기가 있었습니다. 바로 1977년 '애니 홀'과 1986년 '한나와 그 자매들'입니다. 그가 연출한 영화의 이력을 볼 때 '애니 홀'이전과 이후, 혹은 '한나와 그 자매들'…
/사진제공=Google DeepMind 2025.03.28 15:45 Noema 22min 약 450년 전, 한 프랑스 철학자가 고급 리조트를 배경으로 다양한 투숙객들 사이의 갈등이 점차 고조되는 모습을 그린 인기 미국 드라마 '화이트 로터스'를 연상케 하는 책을 썼다. 장 보댕(Jean Bodin)의 '숭고함의 비밀에 관한 7인의 대화'에서는 엄청난 부를 지닌 베네치아 귀족 코로나이우스가 여섯 명의 손님을 자신의 저택으로 초대해 일주일 동안 오락과 대화를 즐기는 이야기가 펼쳐진다. (This article was produced…
What It Means Untoward is a formal word that describes something that is improper or inappropriate, or that is adverse or unfavorable. // The medication is safe and effective, with no known untoward side effects. // The investigation found that nothing untoward had happened at the event. See the…
The only amphibian to live north of the Arctic Circle, the wood frog (Lithobates sylvaticus) has an amazing ability to undergo freezing and thawing to survive cold winters. The world's weirdest and strangest frogs you (probably) never heard of - or even imagined existed... As you might guess from…
[ombates] shares a step-by-step method for making a conductive bio-string from scratch, no fancy equipment required. She demonstrates using it to create a decorative top with touch-sensitive parts, controlling animations on an RGB LED pendant. To top it off, it’s even biodegradable! The string is an…
Earth | Earth How do you re-home a rhino by helicopter? Upside down (Image credit: Micky Wiswedel WWF) By Riley Farrell Moving endangered rhinos to new areas is a vital part of their conservation. War-torn helicopters from the Vietnam war are airlifting the creatures to safety. Zipping through the…
What It Means To elucidate something is to make it clear or easy to understand. // The writer elucidates complex medical findings for a general audience. See the entry > elucidate in Context “Building flexible classrooms gives the building a lifespan beyond one class or even one era of pedagogy,…
March 26, 2025 Volume 23, issue 1 PDF String Matching at Scale A call for interdisciplinary collaboration and better-directed resources Dennis Roellke Freshly brewed coffee steaming from my favorite mug and an open newspaper in my hands, I am ready to enjoy this beautiful Sunday. I take a bite from…
In the world of concurrent systems, especially when we're dealing with high-load distributed environments, finding a balance between data consistency and system performance is a constant headache. The main catch here is synchronization mechanisms, especially locks. These guys ensure that processes…
Thoughtful stories for thoughtless times. Longreads has published hundreds of original stories—personal essays, reported features, reading lists, and more—and more than 13,000 editor’s picks. And they’re all funded by readers like you. Become a member today. I want to support Longreads A Note on…
What It Means Archetype refers to someone or something that is seen to be a perfect example. It is also a word for the original pattern or model of which all things of the same type are representations or copies. // The college’s most popular philosophy professor is the archetype of the preoccupied…
중앙SUNDAY 뉴스 먼나라 이웃나라 역사 프리즘 [먼나라 이웃나라 역사 프리즘] <73> 평화의 이면 중앙선데이 입력 2025.03.28 15:30 업데이트 2025.03.28 21:33 935호 36면 중앙일보 지면보기 서비스는 로그인 후 이용 가능합니다. 최근 1개월 내 지면만 열람하실 수 있습니다. 중앙일보 지면보기 서비스는 로그인 후 이용 가능합니다. 로그인 하시면 최신호의 전체 내용을 보실 수 있습니다. 로그인 하시겠습니까? 더중앙플러스 회원이 되시면 창간호부터 전체 지면보기와 지면 다운로드가 가능합니다. 더중앙플러스…
Opinion Computing Applications Get out of town with style. By Posted Mar 28 2025 Consider a set of n items I. You have purchased k copies of each item as well as k bags. Each bag can hold all or any subset of the n items of I. The goal is to preload the k bags so that if you need a certain subset S…
Ubiquity is dedicated to helping professionals and informed laymen better imagine and understand the future of computing. Extraordinary Ordinary Things (EOT) is dedicated to bringing to mind truly world-transforming things that have become so embedded in daily life that we scarcely even notice them.…
Functional programming languages see types not just as buckets of things that can contain values, but as assertions, e.g., this is not just a string that I vaguely hope is a Username, but this is a validated, certain-to-exist Username for a user, and anything that receives an input parameter to some…
시 아픔을 달래는 '초록빛': 시의 힘에 대한 성찰 앤 카슨의 시집 '잘못된 규범'(2024) /사진제공=New Directions Publishing 2025.03.28 15:46 6min 모든 것이 점점 더 물질적 가치로 환원되고 평가받는 듯한 오늘날의 세상에서 시는 과연 어떤 일을 할 수 있을까? 효용을 중요시하고 이윤을 추구해야 비로소 살아남는 현대인들에게 시가 의미 있게 다가오는 순간이 있기는 한 것일까? 요즘 같은 시절 그나마 조금이라도 시에 마음이 끌리는 계기가 있다면, 그건 아마도 어떤 아픔이 불쑥 찾아와 우리 곁에…
뇌 영상 기술의 등장 1901년 독일 정신과 의사인 알로이스 알츠하이머1864년~1916년 박사는 조증과 불면증 증상, 그리고 인지장애를 동반한 특이한 환자를 만납니다. 이 환자는 알츠하이머 박사를 만난 지 5년 뒤인 1906년 사망합니다. 알츠하이머 박사는 이 환자를 부검하여 뇌 조직의 특이적인 병리학적 관찰 결과를 발견합니다. 그리고 1년 뒤, 환자의 대뇌피질에서 현재는 아밀로이드 플라크Amyloid plaque로 알려진 병변을 최초로 발견하여 학계에 보고합니다. 1910년, 알츠하이머 박사의 동료였던 독일 정신의학자 에밀…
There are two main types of fixed-precision integers in modern software: unsigned and signed. In C++20 and above, the signed integers must use the two’s complement convention. Other programming languages typically specify two’s complement as well. Two’s complement is a method for representing signed…
In my last post, I presented a hazard pointer implementation: A Lock-Free Stack: A Hazard Pointer Implementation. Today, I will explain the implementation. MyNode is a class template, parametrized by the type it holds: data. MyNode models the concept Node. template concept Node = requires(T a) {…
Different 64-bit processor ABIs have different policies on how 32-bit bit values are passed in 64-bit registers. Let’s see if we can find a pattern among the Windows ABIs. Contents of upper 32 bits of 64-bit register holding a 32-bit value Processor 32-bit signed value 32-bit unsigned value AArch64…
No articles.