c++: Propagate using decls from partitions [PR114868]
[official-gcc.git] / libcody / packet.cc
blob65dc8f4315547bc5f43226dfe675d0428f7c0f60
1 // CODYlib -*- mode:c++ -*-
2 // Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
3 // License: Apache v2.0
5 // Cody
6 #include "internal.hh"
8 namespace Cody {
10 void Packet::Destroy ()
12 switch (cat)
14 case STRING:
15 // Silly scope destructor name rules
16 using S = std::string;
17 string.~S ();
18 break;
20 case VECTOR:
21 using V = std::vector<std::string>;
22 vector.~V ();
23 break;
25 default:;
29 void Packet::Create (Packet &&t)
31 cat = t.cat;
32 code = t.code;
33 request = t.request;
34 switch (cat)
36 case STRING:
37 new (&string) std::string (std::move (t.string));
38 break;
40 case VECTOR:
41 new (&vector) std::vector<std::string> (std::move (t.vector));
42 break;
44 default:
45 integer = t.integer;
46 break;