#pragma once #include #include namespace AST { template struct NamedNS { ::std::string name; T data; bool is_pub; NamedNS(): is_pub(false) {} NamedNS(NamedNS&&) = default; NamedNS(const NamedNS&) = default; NamedNS& operator=(NamedNS&&) = default; NamedNS(::std::string name, T data, bool is_pub): name( ::std::move(name) ), data( ::std::move(data) ), is_pub( is_pub ) { } //friend ::std::ostream& operator<<(::std::ostream& os, const Named& i) { // return os << (i.is_pub ? "pub " : " ") << i.name << ": " << i.data; //} }; template struct Named: public NamedNS { Named(): NamedNS() {} Named(Named&&) = default; Named(const Named&) = default; Named& operator=(Named&&) = default; Named(::std::string name, T data, bool is_pub): NamedNS( ::std::move(name), ::std::move(data), is_pub ) {} }; template using NamedList = ::std::vector >; } // namespace AST