This commit is contained in:
Garux
2022-10-27 09:10:31 +03:00
parent b1e5581c60
commit 9d3d204018
289 changed files with 13557 additions and 33481 deletions

View File

@@ -33,17 +33,6 @@
#include "instancelib.h"
#include "treemodel.h"
class StringEqualPredicate
{
const char* m_string;
public:
StringEqualPredicate( const char* string ) : m_string( string ){
}
bool operator()( const char* other ) const {
return string_equal( m_string, other );
}
};
template<std::size_t SIZE>
class TypeIdMap
{
@@ -56,9 +45,9 @@ public:
TypeIdMap() : m_typeNamesEnd( m_typeNames ){
}
TypeId getTypeId( const char* name ){
TypeName* i = std::find_if( m_typeNames, m_typeNamesEnd, StringEqualPredicate( name ) );
TypeName* i = std::find_if( m_typeNames, m_typeNamesEnd, [name]( const char* other ){ return string_equal( name, other ); } );
if ( i == m_typeNamesEnd ) {
ASSERT_MESSAGE( m_typeNamesEnd != m_typeNames + SIZE, "reached maximum number of type names supported (" << Unsigned( SIZE ) << ")" );
ASSERT_MESSAGE( m_typeNamesEnd != m_typeNames + SIZE, "reached maximum number of type names supported (" << SIZE << ")" );
*m_typeNamesEnd++ = name;
}
return i - m_typeNames;