Quick Q: Are constexpr variables and macros basically the same? -- StackOverflow

Save to:
Instapaper Pocket Readability

Quick A: No. For starters, one is in the language, and one isn't.

Recently on SO:

Constexpr vs macros

Where should I prefer using macros and where should I prefer constexpr? Aren't they basically the same?

#define MAX_HEIGHT 720


constexpr unsigned int max_height = 720;


Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.