C++Typedef and type aliases

Introduction

The typedef and (since C++11) using keywords can be used to give a new name to an existing type.

Syntax

  • typedef type-specifier-seq init-declarator-list;
  • attribute-specifier-seq typedef decl-specifier-seq init-declarator-list; // since C++11
  • using identifier attribute-specifier-seq(opt) = type-id; // since C++11

Related Examples