part of the error:
463 | const T& cow_read(const T &v) {
| ^~~~
/usr/local/include/sigslot/signal.hpp:463:10: note: template argument deduction/substitution failed:
/usr/local/include/sigslot/signal.hpp:1182:54: note: couldn’t deduce template parameter ‘T’
1182 | for (const auto &group : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp:468:10: note: candidate: ‘template const T& sigslot::detail::cow_read(sigslot::detail::copy_on_write&)’
468 | const T& cow_read(copy_on_write &v) {
| ^~~~
/usr/local/include/sigslot/signal.hpp:468:10: note: template argument deduction/substitution failed:
/usr/local/include/sigslot/signal.hpp:1182:54: note: couldn’t deduce template parameter ‘T’
1182 | for (const auto &group : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::disconnect(const Callable&, const Obj&)’:
/usr/local/include/sigslot/signal.hpp:1423:41: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
1423 | return disconnect_if([&] (const auto &s) {
| ^~~~
/usr/local/include/sigslot/signal.hpp: In lambda function:
/usr/local/include/sigslot/signal.hpp:1424:21: error: base operand of ‘->’ is not a pointer
1424 | return s->has_object(obj) && s->has_callable(c);
| ^~
/usr/local/include/sigslot/signal.hpp:1424:43: error: base operand of ‘->’ is not a pointer
1424 | return s->has_object(obj) && s->has_callable(c);
| ^~
/usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::disconnect(sigslot::group_id)’:
/usr/local/include/sigslot/signal.hpp:1439:46: error: ‘m_slots’ was not declared in this scope
1439 | for (auto &group : detail::cow_write(m_slots)) {
| ^~~
/usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::slot_count()’:
/usr/local/include/sigslot/signal.hpp:1486:9: error: ‘cow_copy_type’ was not declared in this scope
1486 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ^~~~~
/usr/local/include/sigslot/signal.hpp:1486:32: error: expected primary-expression before ‘,’ token
1486 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ^
/usr/local/include/sigslot/signal.hpp:1486:42: error: expected primary-expression before ‘>’ token
1486 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ^
/usr/local/include/sigslot/signal.hpp:1486:50: error: there are no arguments to ‘slots_reference’ that depend on a template parameter, so a declaration of ‘slots_reference’ must be available [-fpermissive]
1486 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ^~~~~~~
/usr/local/include/sigslot/signal.hpp:1488:50: error: no matching function for call to ‘cow_read()’
1488 | for (const auto &g : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp:463:10: note: candidate: ‘template const T& sigslot::detail::cow_read(const T&)’
463 | const T& cow_read(const T &v) {
| ^~~~
/usr/local/include/sigslot/signal.hpp:463:10: note: template argument deduction/substitution failed:
/usr/local/include/sigslot/signal.hpp:1488:50: note: couldn’t deduce template parameter ‘T’
1488 | for (const auto &g : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp:468:10: note: candidate: ‘template const T& sigslot::detail::cow_read(sigslot::detail::copy_on_write&)’
468 | const T& cow_read(copy_on_write &v) {
| ^~~~
/usr/local/include/sigslot/signal.hpp:468:10: note: template argument deduction/substitution failed:
/usr/local/include/sigslot/signal.hpp:1488:50: note: couldn’t deduce template parameter ‘T’
1488 | for (const auto &g : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base< , >::clean(sigslot::detail::slot_state*)’:
/usr/local/include/sigslot/signal.hpp:1504:46: error: ‘m_slots’ was not declared in this scope
1504 | for (auto &group : detail::cow_write(m_slots)) {
| ^~~
/usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base< , >::add_slot(sigslot::signal_base< , >::slot_ptr&&)’:
/usr/local/include/sigslot/signal.hpp:1538:42: error: ‘m_slots’ was not declared in this scope
1538 | auto &groups = detail::cow_write(m_slots);
| ^~~
/usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::disconnect_if(Cond&&)’:
/usr/local/include/sigslot/signal.hpp:1560:42: error: ‘m_slots’ was not declared in this scope
1560 | auto &groups = detail::cow_write(m_slots);
| ^~~
/usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base< , >::clear()’:
/usr/local/include/sigslot/signal.hpp:1584:27: error: ‘m_slots’ was not declared in this scope
1584 | detail::cow_write(m_slots).clear();
| ^~~
/usr/local/include/sigslot/signal.hpp: In instantiation of ‘void sigslot::signal_base< , >::operator()(U&& ...) [with U = {pangolin::VarState::Event}; Lockable = std::mutex; T = {pangolin::VarState::Event}]’:
/usr/local/include/pangolin/var/varstate.h:264:23: required from ‘std::map<std::cxx11::basic_string, std::shared_ptr >::iterator pangolin::VarState::AddUpgradedVar(const std::shared_ptr<pangolin::VarValue >&, const iterator&, bool) [with T = bool; std::map<std::__cxx11::basic_string, std::shared_ptr >::iterator = std::_Rb_tree_iterator<std::pair<const std::cxx11::basic_string, std::shared_ptr > >]’
/usr/local/include/pangolin/var/varstate.h:205:13: required from ‘std::shared_ptr pangolin::VarState::GetOrCreateVar(const T&, const pangolin::VarMeta&) [with T = bool]’
/usr/local/include/pangolin/var/var.h:83:50: required from ‘pangolin::Var::Var(const T&, const pangolin::VarMeta&) [with T = bool]’
/usr/local/include/pangolin/var/var.h:88:35: required from ‘pangolin::Var::Var(const string&, const T&) [with T = bool; std::string = std::__cxx11::basic_string]’
/usr/local/include/pangolin/display/widgets.h:153:50: required from here
/usr/local/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope
1180 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ~~~^~
make[2]: [CMakeFiles/visualizeGeometry.dir/build.make:63:CMakeFiles/visualizeGeometry.dir/visualizeGeometry.cpp.o] 错误 1
make[1]: [CMakeFiles/Makefile2:76:CMakeFiles/visualizeGeometry.dir/all] 错误 2
===================================================================================================
the reason in my case is mainly the version conflict of c++, the error is fixed when using c++ 17 mandatory use by adding these two lines in the cmakelist.txt:
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
part of the error: 463 | const T& cow_read(const T &v) { | ^ const T& sigslot::detail::cow_read(sigslot::detail::copy_on_write&)’
468 | const T& cow_read(copy_on_write &v) {
| ^, >::disconnect(const Callable&, const Obj&)’:
/usr/local/include/sigslot/signal.hpp:1423:41: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
1423 | return disconnect_if([&] (const auto &s) {
| ^~~~
/usr/local/include/sigslot/signal.hpp: In lambda function:
/usr/local/include/sigslot/signal.hpp:1424:21: error: base operand of ‘->’ is not a pointer
1424 | return s->has_object(obj) && s->has_callable(c);
| ^~
/usr/local/include/sigslot/signal.hpp:1424:43: error: base operand of ‘->’ is not a pointer
1424 | return s->has_object(obj) && s->has_callable(c);
| ^~
/usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base< , >::disconnect(sigslot::group_id)’:
/usr/local/include/sigslot/signal.hpp:1439:46: error: ‘m_slots’ was not declared in this scope
1439 | for (auto &group : detail::cow_write(m_slots)) {
| ^, >::slot_count()’:
/usr/local/include/sigslot/signal.hpp:1486:9: error: ‘cow_copy_type’ was not declared in this scope
1486 | cow_copy_type<list_type, Lockable> ref = slots_reference();
| ^)’
1488 | for (const auto &g : detail::cow_read(ref)) {
| ^
/usr/local/include/sigslot/signal.hpp:463:10: note: candidate: ‘template const T& sigslot::detail::cow_read(const T&)’
463 | const T& cow_read(const T &v) {
| ^ const T& sigslot::detail::cow_read(sigslot::detail::copy_on_write&)’
468 | const T& cow_read(copy_on_write &v) {
| ^, >::clean(sigslot::detail::slot_state*)’:
/usr/local/include/sigslot/signal.hpp:1504:46: error: ‘m_slots’ was not declared in this scope
1504 | for (auto &group : detail::cow_write(m_slots)) {
| ^, >::add_slot(sigslot::signal_base< , >::slot_ptr&&)’:
/usr/local/include/sigslot/signal.hpp:1538:42: error: ‘m_slots’ was not declared in this scope
1538 | auto &groups = detail::cow_write(m_slots);
| ^, >::disconnect_if(Cond&&)’:
/usr/local/include/sigslot/signal.hpp:1560:42: error: ‘m_slots’ was not declared in this scope
1560 | auto &groups = detail::cow_write(m_slots);
| ^, >::clear()’:
/usr/local/include/sigslot/signal.hpp:1584:27: error: ‘m_slots’ was not declared in this scope
1584 | detail::cow_write(m_slots).clear();
| ^, >::operator()(U&& ...) [with U = {pangolin::VarState::Event}; Lockable = std::mutex; T = {pangolin::VarState::Event}]’:
/usr/local/include/pangolin/var/varstate.h:264:23: required from ‘std::map<std::cxx11::basic_string, std::shared_ptr >::iterator pangolin::VarState::AddUpgradedVar(const std::shared_ptr<pangolin::VarValue >&, const iterator&, bool) [with T = bool; std::map<std::__cxx11::basic_string, std::shared_ptr >::iterator = std::_Rb_tree_iterator<std::pair<const std:: cxx11::basic_string, std::shared_ptr > >]’
/usr/local/include/pangolin/var/varstate.h:205:13: required from ‘std::shared_ptr pangolin::VarState::GetOrCreateVar(const T&, const pangolin::VarMeta&) [with T = bool]’
/usr/local/include/pangolin/var/var.h:83:50: required from ‘pangolin::Var::Var(const T&, const pangolin::VarMeta&) [with T = bool]’
/usr/local/include/pangolin/var/var.h:88:35: required from ‘pangolin::Var::Var(const string&, const T&) [with T = bool; std::string = std::__cxx11::basic_string]’
/usr/local/include/pangolin/display/widgets.h:153:50: required from here
/usr/local/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope
1180 | cow_copy_type<list_type, Lockable> ref = slots_reference();
|
~~~ /usr/local/include/sigslot/signal.hpp:463:10: note: template argument deduction/substitution failed: /usr/local/include/sigslot/signal.hpp:1182:54: note: couldn’t deduce template parameter ‘T’ 1182 | for (const auto &group : detail::cow_read(ref)) { | ^ /usr/local/include/sigslot/signal.hpp:468:10: note: candidate: ‘template~~~ /usr/local/include/sigslot/signal.hpp:468:10: note: template argument deduction/substitution failed: /usr/local/include/sigslot/signal.hpp:1182:54: note: couldn’t deduce template parameter ‘T’ 1182 | for (const auto &group : detail::cow_read(ref)) { | ^ /usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base<~~ /usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base<~~~~ /usr/local/include/sigslot/signal.hpp:1486:32: error: expected primary-expression before ‘,’ token 1486 | cow_copy_type<list_type, Lockable> ref = slots_reference(); | ^ /usr/local/include/sigslot/signal.hpp:1486:42: error: expected primary-expression before ‘>’ token 1486 | cow_copy_type<list_type, Lockable> ref = slots_reference(); | ^ /usr/local/include/sigslot/signal.hpp:1486:50: error: there are no arguments to ‘slots_reference’ that depend on a template parameter, so a declaration of ‘slots_reference’ must be available [-fpermissive] 1486 | cow_copy_type<list_type, Lockable> ref = slots_reference(); | ^~~~~~~ /usr/local/include/sigslot/signal.hpp:1488:50: error: no matching function for call to ‘cow_read(~~~ /usr/local/include/sigslot/signal.hpp:463:10: note: template argument deduction/substitution failed: /usr/local/include/sigslot/signal.hpp:1488:50: note: couldn’t deduce template parameter ‘T’ 1488 | for (const auto &g : detail::cow_read(ref)) { | ^ /usr/local/include/sigslot/signal.hpp:468:10: note: candidate: ‘template~~~ /usr/local/include/sigslot/signal.hpp:468:10: note: template argument deduction/substitution failed: /usr/local/include/sigslot/signal.hpp:1488:50: note: couldn’t deduce template parameter ‘T’ 1488 | for (const auto &g : detail::cow_read(ref)) { | ^ /usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base<~~ /usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base<~~ /usr/local/include/sigslot/signal.hpp: In member function ‘size_t sigslot::signal_base<~~ /usr/local/include/sigslot/signal.hpp: In member function ‘void sigslot::signal_base<~~ /usr/local/include/sigslot/signal.hpp: In instantiation of ‘void sigslot::signal_base<~~~^~ make[2]: [CMakeFiles/visualizeGeometry.dir/build.make:63:CMakeFiles/visualizeGeometry.dir/visualizeGeometry.cpp.o] 错误 1 make[1]: [CMakeFiles/Makefile2:76:CMakeFiles/visualizeGeometry.dir/all] 错误 2=================================================================================================== the reason in my case is mainly the version conflict of c++, the error is fixed when using c++ 17 mandatory use by adding these two lines in the cmakelist.txt: set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF)
and cmake.. again and make in the build dir