According to the C++23 standard, what is the output of this program?
#include <iostream>
#include <vector>
typedef std::vector<int> TVint;
int main() {
TVint t(1);
std::cout << (typeid(t) == typeid(std::vector<int>));
}A typedef-name is a synonym for another type.
1
The typedef specifier provides a way for declaring a type alias. However, it does not introduce a new type-id. §[dcl.typedef]¶1 in the standard:
A name declared with the
typedefspecifier becomes a typedef-name. A typedef-name names the type associated with the identifier (§[dcl.decl]) or simple-template-id (§[temp.pre]); a typedef-name is thus a synonym for another type. A typedef-name does not introduce a new type the way a class declaration (§[class.name]) or enum declaration (§[dcl.enum]) does.