关于本章
本章讨论C++17引入的**Common vocabulary types**。
What is vocabulary type?
"vocabulary" 的意思是 "词汇",那"vocabulary type"的含义是什么呢?
packtpub Chapter 5. Vocabulary Types
A "vocabulary" type is a type that purports to provide a single lingua franca, a common language, for dealing with its domain.
“词汇表”类型声称提供一种单一的*通用语*,一种通用语言,用于处理其域。
stackoverflow What are “vocabulary types”, and how many exist?
Across programming languages, I've encountered similar composite types with different names:
People often use the term vocabulary type, yet I've never seen a definition of what makes a type "vocabulary".
foonathan What should be part of the C++ standard library? # 2. Vocabulary types and concepts
How To Use Vocabulary Types from C++17?
bfilipek How To Use Vocabulary Types from C++17, Presentation
C++ VS C
std::any
type erasure,是对void *
的增强。
std::variant
对union
的增强。