StackOverflow Questions for Tag: constexpr-function

user51462
user51462

Reputation: 2072

Can `constexpr` functions contain side-effects?

Score: 3

Views: 401

Answers: 0

Read More
jsfpdn
jsfpdn

Reputation: 83

Why should constexpr functions contain exactly one return statement?

Score: 3

Views: 242

Answers: 1

Read More
shar yashuv Giat
shar yashuv Giat

Reputation: 1

how to make a field of a constexpr object constexpr too?

Score: 0

Views: 75

Answers: 0

Read More
jabluko
jabluko

Reputation: 23

error while trying to compile .data() from std::array as a constexpr function in c++20

Score: 2

Views: 222

Answers: 3

Read More
AK87
AK87

Reputation: 623

Static assertion if one std::array is a subset of the other

Score: 1

Views: 98

Answers: 2

Read More
Andi Abrudan
Andi Abrudan

Reputation: 134

What is the proper definition for a constexpr function that take a character array?

Score: 2

Views: 143

Answers: 2

Read More
lomo
lomo

Reputation: 23

how to check that const array members grow monotonically at compile time

Score: 2

Views: 125

Answers: 2

Read More
std_unordered_map
std_unordered_map

Reputation: 113

Getting the value of a constexpr std::variant via constexpr function

Score: 1

Views: 44

Answers: 0

Read More
Carlo Wood
Carlo Wood

Reputation: 6821

Is it possible with C++20 to have a constexpr function return a tuple of types that have static constexpr array's with a value passed though a macro?

Score: 5

Views: 791

Answers: 1

Read More
palapapa
palapapa

Reputation: 959

A constexpr function that calculates how deep a std::vector is nested

Score: 6

Views: 403

Answers: 3

Read More
glades
glades

Reputation: 4848

X is not a valid template argument for 'const char*' because it is not the address of a variable

Score: 2

Views: 622

Answers: 0

Read More
bun9
bun9

Reputation: 201

Why does full `constexpr` enabling of a data structure cause the compiled code to be bigger?

Score: 2

Views: 155

Answers: 1

Read More
dVNE
dVNE

Reputation: 161

Initialize a pointer with constinit

Score: 0

Views: 232

Answers: 1

Read More
navid
navid

Reputation: 27

How to check if instances of a class with a constexpr constructor get instantiated at compile time?

Score: 0

Views: 153

Answers: 1

Read More
mada
mada

Reputation: 1985

confusion about constexpr function body

Score: 0

Views: 387

Answers: 1

Read More
Chris G.
Chris G.

Reputation: 846

Implementation of typed tuple wrapper

Score: 1

Views: 123

Answers: 1

Read More
dtldarek
dtldarek

Reputation: 989

constexpr result from non-constexpr call

Score: 9

Views: 1170

Answers: 1

Read More
Vanconts
Vanconts

Reputation: 45

literal type in constexpr expression and template parameter

Score: 0

Views: 184

Answers: 1

Read More
MiCo
MiCo

Reputation: 401

constexpr function which is shared in multiple modules

Score: 3

Views: 903

Answers: 2

Read More
digito_evo
digito_evo

Reputation: 3682

A "constexpr" function should not be declared "inline"

Score: 5

Views: 729

Answers: 1

Read More
PreviousPage 2Next