Skip to content

Commit

Permalink
add an extra template
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Dec 3, 2024
1 parent 58185bb commit dc71e18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/libfolia/folia_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ namespace folia {
return index(i);
}

template< typename T>
bool acceptable(){
return this->acceptable( T::PROPS.ELEMENT_ID );
}

template <typename F>
bool isinstance() const {
return element_id() == F::PROPS.ELEMENT_ID;
Expand Down
2 changes: 1 addition & 1 deletion src/folia_subclasses.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ namespace folia {
|| p->isSubClass<AbstractWord>()
|| p->isSubClass<AbstractStructureElement>()
|| p->isSubClass<AbstractSubtokenAnnotation>( ) )
&& p->acceptable( ElementType::TextContent_t ) ){
&& p->acceptable<TextContent>() ){
if ( ++depth == 2 ){
return p;
}
Expand Down

0 comments on commit dc71e18

Please sign in to comment.