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

vs

constexpr unsigned int max_height = 720;

 

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.