前提
c++で書かれたコードをコンパイルしたときに、以下のエラーが出てしまいました。
解決方法をお教えいただけると幸いです。
発生している問題・エラーメッセージ
In file included from Inclusions.h:23, from childmain.cpp:41: tMeshList/tMeshList.h: メンバ関数 ‘void tMeshList<NodeType, ListNodeType>::insertAtActiveBack(const NodeType&)’ 内: tMeshList/tMeshList.h:288:37: エラー: expected unqualified-id before ‘this’ 288 | tList< NodeType, ListNodeType >::this->insertAtNext( value, lastactive ); | ^~~~ tMeshList/tMeshList.h: In instantiation of ‘void tMeshList<NodeType, ListNodeType>::moveToBack(const NodeType*) [with NodeType = tLNode; ListNodeType = tListNodeListable<tLNode>]’: tMesh/tMesh.cpp:2845:29: required from ‘int tMesh<tSubNode>::ExtricateNode(tSubNode*, tPtrList<NodeType>&) [with tSubNode = tLNode]’ tMesh/tMesh.cpp:2739:11: required from ‘int tMesh<tSubNode>::DeleteNode(tMesh<tSubNode>::nodeListNode_t*, kRepairMesh_t, kUpdateMesh_t, bool) [with tSubNode = tLNode; tMesh<tSubNode>::nodeListNode_t = tListNodeListable<tLNode>]’ tMesh/tMesh.cpp:2669:22: required from ‘int tMesh<tSubNode>::DeleteNode(const tSubNode*, kRepairMesh_t, kUpdateMesh_t, bool) [with tSubNode = tLNode]’ tMesh/tMesh.cpp:1732:14: required from ‘void tMesh<tSubNode>::MakeMeshFromPoints(const tInputFile&) [with tSubNode = tLNode]’ tMesh/tMesh.cpp:182:6: required from ‘tMesh<tSubNode>::tMesh(const tInputFile&, bool) [with tSubNode = tLNode]’ childmain.cpp:98:63: required from here tMeshList/tMeshList.h:403:39: エラー: ‘getListNode’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] 403 | ListNodeType * mvnode = getListNode( mvnodedata ); | ~~~~~~~~~~~^~~~~~~~~~~~~~ tMeshList/tMeshList.h:403:39: 備考: declarations in dependent base ‘tList<tLNode, tListNodeListable<tLNode> >’ are not found by unqualified lookup tMeshList/tMeshList.h:403:39: 備考: use ‘this->getListNode’ instead
該当のソースコード
該当すると思われる個所のコードです。
c++
1 2template< class NodeType, class ListNodeType > 3void tMeshList< NodeType, ListNodeType >:: 4insertAtFront( const NodeType &value ) 5{ 6 tList< NodeType, ListNodeType >::insertAtFront( value ); 7 if( value.isNonBoundary() ) 8 { 9 if( isActiveEmpty() ) lastactive = this->first; 10 ++nActiveNodes; 11 } 12} 13 14template< class NodeType, class ListNodeType > 15void tMeshList< NodeType, ListNodeType >:: 16insertAtBoundFront( const NodeType &value ) 17{ 18 // Case list empty or active part of list empty: 19 if( this->isEmpty() || lastactive==0 ) 20 { 21 tList< NodeType, ListNodeType >::insertAtFront( value ); 22 return; 23 } 24 // Usual case: list and active part of list NOT empty: 25 this->insertAtNext( value, lastactive ); 26} 27 28 29template< class NodeType, class ListNodeType > 30int tMeshList< NodeType, ListNodeType >:: 31removeFromBoundFront( NodeType &value ) 32{ 33 if( lastactive == 0 ) return removeFromFront( value ); 34 return removeNext( value, lastactive ); 35} 36 37 38template< class NodeType, class ListNodeType > 39void tMeshList< NodeType, ListNodeType >:: 40insertAtActiveBack( const NodeType &value ) 41{ 42 // Case list empty or active part of list empty: 43 if( lastactive==0 ) 44 { 45 insertAtFront( value ); 46 return; 47 } 48 // Usual case: list and active part of list NOT empty: 49 tList< NodeType, ListNodeType >::this->insertAtNext( value, lastactive ); 50 lastactive = lastactive->next; 51 ++nActiveNodes; 52} 53 54template< class NodeType, class ListNodeType > 55int tMeshList< NodeType, ListNodeType >:: 56removeFromActiveBack( NodeType &value ) 57{ 58 if( lastactive == 0 ) return 0; 59 if( this->first == lastactive ) return removeFromFront( value ); 60 return removeNext( value, lastactive->prev ); 61} 62 63template< class NodeType, class ListNodeType > 64int tMeshList< NodeType, ListNodeType >:: 65removeFromFront( NodeType &value ) 66{ 67 if( !isActiveEmpty() ) 68 { 69 --nActiveNodes; 70 if( lastactive == this->first ) lastactive = 0; 71 } 72 return tList< NodeType, ListNodeType >::removeFromFront( value ); 73} 74 75//delete next node 76template< class NodeType, class ListNodeType > 77int tMeshList< NodeType, ListNodeType >:: 78removeNext( NodeType &value, ListNodeType * ptr ) 79{ 80 if( ptr == 0 ) return 0; 81 if( ptr->next == 0 ) return 0; 82 if( value.isNonBoundary() ) 83 { 84 --nActiveNodes; 85 if( ptr->next == lastactive ) 86 lastactive = ptr; 87 } 88 return tList< NodeType, ListNodeType >::removeNext( value, ptr ); 89} 90 91//delete previous node 92template< class NodeType, class ListNodeType > 93int tMeshList< NodeType, ListNodeType >:: 94removePrev( NodeType &value, ListNodeType * ptr ) 95{ 96 if( ptr == 0 ) return 0; 97 if( ptr->prev == 0 ) return 0; 98 if( value.isNonBoundary() ) 99 { 100 --nActiveNodes; 101 if( ptr->prev == lastactive ) 102 lastactive = lastactive->prev; 103 } 104 return tList< NodeType, ListNodeType >::removePrev( value, ptr ); 105} 106
補足情報(FW/ツールのバージョンなど)
windows10
cygwin を使用しています。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/09/30 10:08