I'm writing a chess program and I've defined the classes I've created under the chess
namespace.
To shorten the code in files that use those classes, I preface it with using chess::Point, chess::Board, chess::Piece
and so on.
Is there a way to specify that I'm bringing in scope multiple elements from the same namespaces like in Rust? (Such as use chess::{Point,Board,Piece}
.)
You could use namespace alias instead of bringing everything into the scope. Create a shorter alias for chess
.
namespace ch = chess;
// ch::Point, ch::Board, ch::Piece // all are valid.