samedi 26 novembre 2016

constexpr function with no argument

I am getting confused around this snippet:

constexpr int f(bool b) {
  return b ? throw 0 : 0; }
constexpr int f() { return f(true); }

directly from the c++ draft. The point I am stucked with is why the standard defines as ill-formed the case of a constexpr function without arguments (stated in the same link). May anyone clarify?

Aucun commentaire:

Enregistrer un commentaire