Modernes C++ programmieren

Okt 23, 2024

lst-0315-book.cpp

namespace plant {
    // … wie zuvor …
    std::ostream& operator<<(std::ostream&, const Baum&) {};
    namespace debug {
        std::ostream& operator<<(std::ostream&, const Baum&) {};
    }
}
plant::Baum baum{"MeinBaum"};
void run() {
    using namespace plant;
    cout << baum << "\n";
}
void diagnostic() {
    using namespace plant::debug;
    cout << baum << "\n";
}
int main() {
    run();
    diagnostic();
}