I understand the general use of anonymous namespaces to contain code that should be only visible to the current source (i.e. non-header) file. However, I'm not able to find any information on what happens in the case below:
// In foo.cpp
#include <vector>
// Choice #1
template <typename T>
using Vec1 = std::vector<T>;
// Choice #2
namespace {
template <typename T>
using Vec2 = std::vector<T>;
}
Do Vec1 and Vec2 differ in any way? Since I can't think of a way to have an "extern" type alias in a header file to reference Vec1, I'm not sure if the anonymous namespace here achieves anything.