| 253 | } |
| 254 | |
| 255 | StructurePtr Structure::clone() const { |
| 256 | auto cs = new Structure(name); |
| 257 | cs->fields.reserve(fields.size()); |
| 258 | for ( auto & fd : fields ) { |
| 259 | cs->fields.emplace_back(fd.name, new TypeDecl(*fd.type), fd.init ? fd.init->clone() : nullptr, fd.annotation, fd.moveSemantics, fd.at); |
| 260 | cs->fields.back().flags = fd.flags; |
| 261 | } |
| 262 | aliases.foreach([&](const TypeDeclPtr & atype) -> bool { |
| 263 | cs->aliases.insert(atype->alias, new TypeDecl(*atype)); |
| 264 | return true; |
| 265 | }); |
| 266 | cs->at = at; |
| 267 | cs->module = module; |
| 268 | cs->flags = flags; |
| 269 | cs->annotations = cloneAnnotationList(annotations); |
| 270 | return cs; |
| 271 | } |
| 272 | |
| 273 | bool Structure::isCompatibleCast ( const Structure & castS ) const { |
| 274 | if (this == &castS) { |