lundi 25 mars 2019

constexpr versus anonymous namespace

What is the difference between the following 2 patterns in creating const values?

constexpr int some_val = 0;

vs

namespace {
   const int some_val = 0;
}

I'm used to the 2nd method but is the 1st equivalent?

Aucun commentaire:

Enregistrer un commentaire