#ifndef INCLUDED_SEMANTIC_ #define INCLUDED_SEMANTIC_ #include #include #include "../base/base.h" class Semantic: public std::shared_ptr { friend std::ostream &operator<<(std::ostream &out, Semantic const &obj); public: Semantic(Base *bp = 0); // Semantic owns the bp ~Semantic() = default; }; inline Semantic::Semantic(Base *bp) : std::shared_ptr(bp) {} inline std::ostream &operator<<(std::ostream &out, Semantic const &obj) { if (obj) return out << *obj; return out << ""; } #endif