Skip to content

Commit

Permalink
move expression evaluation outside typeid()
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldsmith committed Apr 4, 2024
1 parent 40d51b4 commit 6f2ee53
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions lib/IlmCtl/CtlType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ VoidType::VoidType (): DataType ()
bool
VoidType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -285,8 +287,10 @@ BoolType::BoolType () : DataType ()
bool
BoolType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -469,8 +473,10 @@ IntType::IntType () : DataType ()
bool
IntType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -687,8 +693,10 @@ UIntType::UIntType () : DataType ()
bool
UIntType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -904,8 +912,10 @@ HalfType::HalfType (): DataType ()
bool
HalfType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -1091,8 +1101,10 @@ FloatType::FloatType (): DataType ()
bool
FloatType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down Expand Up @@ -1279,8 +1291,10 @@ StringType::StringType (): DataType ()
bool
StringType::isSameTypeAs (const TypePtr &t) const
{
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
auto& t1 = *this;
const type_info& ti1 = typeid(t1);
auto& t2 = *t;
const type_info& ti2 = typeid(t2);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}
Expand Down

0 comments on commit 6f2ee53

Please sign in to comment.