title: (C++) Whether I should put a constant in a namespace or not
body: <p>I am coming from Java background and trying to fix some c++ code that's a legacy.</p>
  
  <p>The structure is like</p>
  
  <pre><code>namespace ABC {
  namespape CDE {
  
  using namespace XYZ; //I do not know about this
  
  //class CCC
  CCC::CCC(...) {};
  
  void CCC::c1(...) {...};
  void CCC::c2(...) {...};
  void CCC::c3(...) {...};
  }
  }
  </code></pre>
  
  <p>and I need to add a constant, but I'm not sure where it should go.</p>
  
  <pre><code>namespace ABC {
  namespape CDE {
  
  namespace {
  const DateTime today = 20200508;
  } // 1st way
  
  const DateTime today = 20200508;  // 2nd way
  
  using namespace XYZ; //I do not know about this
  
  
  //class CCC
  CCC::CCC(...) {};
  
  void CCC::c1(...) {... today ...};
  void CCC::c2(...) {... today ...};
  void CCC::c3(...) {... today ...};
  }
  }
  </code></pre>
  
  <p>So all the functions in this CCC class are dealing with this date and I would like to create a const.</p>
  
  <p>1) Where is it more appropriate, 1st way or 2nd way?</p>
  
  <p>2) What are the differences are between these two places? Both way it built without errors, FYI.</p>
  
  <p>3) Should this const declaration go before or after this line: using namespace XYZ?</p>
  
  <p>Thank you!</p>