Skip to content

Commit e3bbd58

Browse files
committed
type_with_subtypest now has constructors that take the subtypes
1 parent 163bc94 commit e3bbd58

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
@@ -114,11 +114,22 @@ inline type_with_subtypet &to_type_with_subtype(typet &type)
114114
class type_with_subtypest:public typet
115115
{
116116
public:
117+
typedef std::vector<typet> subtypest;
118+
117119
type_with_subtypest() { }
118120

119121
explicit type_with_subtypest(const irep_idt &_id):typet(_id) { }
120122

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

123134
subtypest &subtypes()
124135
{

0 commit comments

Comments
 (0)