Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:4:1: error: redefinition of ‘BST::BST()’
- 4 | BST::BST(){
- | ^~~
- In file included from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:26:3: note: ‘BST::BST()’ previously defined here
- 26 | BST(){
- | ^~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘std::shared_ptr<bst_node> BST::InitNode(int)’:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:13:3: error: ‘var’ was not declared in this scope
- 13 | var node = new bst_node(data, NULL, NULL);
- | ^~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:15:31: error: ‘node’ was not declared in this scope
- 15 | return shared_ptr<bst_node>(node);
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::Insert(std::shared_ptr<bst_node>)’:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:22:31: warning: NULL used in arithmetic [-Wpointer-arith]
- 22 | while (currentNode->data != NULL){
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::Remove(int)’:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:54:31: warning: NULL used in arithmetic [-Wpointer-arith]
- 54 | while (currentNode->data != NULL){
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:65:29: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
- 65 | currentNode->data = NULL;
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:68:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
- 68 | bst_node tempNode = copy(currentNode);
- | ^
- In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
- from /usr/include/c++/9.1.0/string:40,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
- 465 | copy(_II __first, _II __last, _OI __result)
- | ^~~~
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:68:45: note: candidate expects 3 arguments, 1 provided
- 68 | bst_node tempNode = copy(currentNode);
- | ^
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:70:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
- 70 | delete tempNode;
- | ^~~~~~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:73:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
- 73 | bst_node tempNode = copy(currentNode);
- | ^
- In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
- from /usr/include/c++/9.1.0/string:40,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
- 465 | copy(_II __first, _II __last, _OI __result)
- | ^~~~
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:73:45: note: candidate expects 3 arguments, 1 provided
- 73 | bst_node tempNode = copy(currentNode);
- | ^
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:75:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
- 75 | delete tempNode;
- | ^~~~~~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:78:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
- 78 | bst_node tempNode = copy(currentNode);
- | ^
- In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
- from /usr/include/c++/9.1.0/string:40,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
- 465 | copy(_II __first, _II __last, _OI __result)
- | ^~~~
- /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:78:45: note: candidate expects 3 arguments, 1 provided
- 78 | bst_node tempNode = copy(currentNode);
- | ^
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:79:24: error: base operand of ‘->’ has non-pointer type ‘bst_node’
- 79 | while (tempNode->left != NULL){
- | ^~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:80:30: error: base operand of ‘->’ has non-pointer type ‘bst_node’
- 80 | tempNode = tempNode->left;
- | ^~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:82:37: error: base operand of ‘->’ has non-pointer type ‘bst_node’
- 82 | currentNode->data = tempNode->data;
- | ^~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:83:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
- 83 | delete tempNode;
- | ^~~~~~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘int BST::Size(std::shared_ptr<bst_node>)’:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:113:20: warning: NULL used in arithmetic [-Wpointer-arith]
- 113 | if(subt->data == NULL){
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::ToVector(std::shared_ptr<bst_node>, std::vector<int>&)’:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:127:14: error: void value not ignored as it ought to be
- 127 | *vec.resize(BST::Size(subt));
- | ~~~~~~~~~~^~~~~~~~~~~~~~~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:129:20: warning: NULL used in arithmetic [-Wpointer-arith]
- 129 | if(subt->data == NULL){
- | ^~~~
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:133:38: error: no matching function for call to ‘std::vector<int>::insert(int&, int&)’
- 133 | *vec.insert(*vec.begin(),subt->data);
- | ^
- In file included from /usr/include/c++/9.1.0/vector:72,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:6,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /usr/include/c++/9.1.0/bits/vector.tcc:130:5: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::value_type = int]’
- 130 | vector<_Tp, _Alloc>::
- | ^~~~~~~~~~~~~~~~~~~
- /usr/include/c++/9.1.0/bits/vector.tcc:132:27: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
- 132 | insert(const_iterator __position, const value_type& __x)
- | ~~~~~~~~~~~~~~~^~~~~~~~~~
- In file included from /usr/include/c++/9.1.0/vector:67,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:6,
- from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
- /usr/include/c++/9.1.0/bits/stl_vector.h:1290:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::value_type = int]’
- 1290 | insert(const_iterator __position, value_type&& __x)
- | ^~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1290:29: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
- 1290 | insert(const_iterator __position, value_type&& __x)
- | ~~~~~~~~~~~~~~~^~~~~~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1307:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*]’
- 1307 | insert(const_iterator __position, initializer_list<value_type> __l)
- | ^~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1307:29: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
- 1307 | insert(const_iterator __position, initializer_list<value_type> __l)
- | ~~~~~~~~~~~~~~~^~~~~~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1332:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = int]’
- 1332 | insert(const_iterator __position, size_type __n, const value_type& __x)
- | ^~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1332:7: note: candidate expects 3 arguments, 2 provided
- /usr/include/c++/9.1.0/bits/stl_vector.h:1376:2: note: candidate: ‘template<class _InputIterator, class> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = int; _Alloc = std::allocator<int>]’
- 1376 | insert(const_iterator __position, _InputIterator __first,
- | ^~~~~~
- /usr/include/c++/9.1.0/bits/stl_vector.h:1376:2: note: template argument deduction/substitution failed:
- /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:133:38: note: candidate expects 3 arguments, 2 provided
- 133 | *vec.insert(*vec.begin(),subt->data);
- | ^
- make[2]: *** [CMakeFiles/run_app.dir/build.make:76: CMakeFiles/run_app.dir/code/BST.cpp.o] Error 1
- make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/run_app.dir/all] Error 2
- make: *** [Makefile:141: all] Error 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement