Skip to content

Commit 00d3be9

Browse files
author
Daniel Kroening
authored
Merge pull request #3159 from diffblue/type_with_subtypes_constructor
type_with_subtypest now has constructors that take the subtypes
2 parents fbd2afe + e3bbd58 commit 00d3be9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/util/type.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,22 @@ inline type_with_subtypet &to_type_with_subtype(typet &type)
112112
class type_with_subtypest:public typet
113113
{
114114
public:
115+
typedef std::vector<typet> subtypest;
116+
115117
type_with_subtypest() { }
116118

117119
explicit type_with_subtypest(const irep_idt &_id):typet(_id) { }
118120

119-
typedef std::vector<typet> subtypest;
121+
type_with_subtypest(const irep_idt &_id, const subtypest &_subtypes)
122+
: typet(_id)
123+
{
124+
subtypes() = _subtypes;
125+
}
126+
127+
type_with_subtypest(const irep_idt &_id, subtypest &&_subtypes) : typet(_id)
128+
{
129+
subtypes() = std::move(_subtypes);
130+
}
120131

121132
subtypest &subtypes()
122133
{

0 commit comments

Comments
 (0)