Skip to main content
"Until (not including)" is more clearly expressed as "Before" or "Prior to"
Source Link
Toby Speight
  • 32.3k
  • 58
  • 83
  • 118

Until (and not including)Prior to C++14, the body of a constexpr function must consist solely of a return statement: it cannot have any other statements inside it. This works in C++11 :

constexpr int func (int x) { return x < 0 ? -x : x; } 

In C++14 and up, what you wrote is legal, as are most other statements.

Source.

Until (and not including) C++14, the body of a constexpr function must consist solely of a return statement: it cannot have any other statements inside it. This works in C++11 :

constexpr int func (int x) { return x < 0 ? -x : x; } 

In C++14 and up, what you wrote is legal, as are most other statements.

Source.

Prior to C++14, the body of a constexpr function must consist solely of a return statement: it cannot have any other statements inside it. This works in C++11 :

constexpr int func (int x) { return x < 0 ? -x : x; } 

In C++14 and up, what you wrote is legal, as are most other statements.

Source.

Source Link
Thomas
  • 183.5k
  • 57
  • 383
  • 510

Until (and not including) C++14, the body of a constexpr function must consist solely of a return statement: it cannot have any other statements inside it. This works in C++11 :

constexpr int func (int x) { return x < 0 ? -x : x; } 

In C++14 and up, what you wrote is legal, as are most other statements.

Source.