mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +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);
|
AddNameInternal(module_name, name, val, is_export);
|
||||||
|
|
||||||
if ( vals.find(val) == vals.end() )
|
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*> types = BroType::GetAliases(GetName());
|
||||||
set<BroType*>::const_iterator it;
|
set<BroType*>::const_iterator it;
|
||||||
|
@ -1265,7 +1265,7 @@ IntrusivePtr<EnumVal> EnumType::GetVal(bro_int_t i)
|
||||||
|
|
||||||
if ( it == vals.end() )
|
if ( it == vals.end() )
|
||||||
{
|
{
|
||||||
rval = IntrusivePtr{AdoptRef{}, new EnumVal(this, i)};
|
rval = make_intrusive<EnumVal>(this, i);
|
||||||
vals[i] = rval;
|
vals[i] = rval;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -998,6 +998,9 @@ protected:
|
||||||
friend class Val;
|
friend class Val;
|
||||||
friend class EnumType;
|
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)
|
EnumVal(EnumType* t, int i) : Val(bro_int_t(i), t)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue