If you are only using namespace alpha, then you can just use class , but if you use both, you'll have to prefix and say alpha:: or beta::. If you are only using beta::X, then you can use print() without a disambig. prefix.