mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Give make_intrusive() access to protected EnumVal ctor
This commit is contained in:
parent
f512ae023e
commit
c6f2e35af0
2 changed files with 5 additions and 2 deletions
|
@ -1209,7 +1209,7 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
|
|||
AddNameInternal(module_name, name, val, is_export);
|
||||
|
||||
if ( vals.find(val) == vals.end() )
|
||||
vals[val] = IntrusivePtr{AdoptRef{}, new EnumVal(this, val)};
|
||||
vals[val] = make_intrusive<EnumVal>(this, val);
|
||||
|
||||
set<BroType*> types = BroType::GetAliases(GetName());
|
||||
set<BroType*>::const_iterator it;
|
||||
|
@ -1265,7 +1265,7 @@ IntrusivePtr<EnumVal> EnumType::GetVal(bro_int_t i)
|
|||
|
||||
if ( it == vals.end() )
|
||||
{
|
||||
rval = IntrusivePtr{AdoptRef{}, new EnumVal(this, i)};
|
||||
rval = make_intrusive<EnumVal>(this, i);
|
||||
vals[i] = rval;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -998,6 +998,9 @@ protected:
|
|||
friend class Val;
|
||||
friend class EnumType;
|
||||
|
||||
template<class T, class... Ts>
|
||||
friend IntrusivePtr<T> make_intrusive(Ts&&... args);
|
||||
|
||||
EnumVal(EnumType* t, int i) : Val(bro_int_t(i), t)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue