Clang Error Reference To Non-static Member Function Must Be Called
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers reference to non-static member function must be called c++ or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Reference To Non-static Member Function Must Be Called Sort
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it reference to non-static member function must be called c++11 only takes a minute: Sign up Unable to call a template member function of a template class from another template class up vote 5 down vote favorite I'm getting compiler errors when attempting to access a template member function of reference to non-static member function must be called template a template class from within another template class. A function call to getSubmatrix results in the compiler warnings, "expression result unused", about the parameters (0, 0), finally failing with the compiler error "reference to non-static member function must be called". The matrix class: template & getSubmatrix(std::size_t column, std::size_t row) { ... } }; The transform class: template [x] New user self-registration is currently disabled. Please email llvm-admin@lists.llvm.org if you need an account. First Last Prev Next This bug is not in your last search results. Bug18995 - Strangely worded error message "reference to non-static member function must be called" Summary: Strangely worded error message "reference to non-static member function must ... Status: NEW Product: clang Classification: Unclassified Component: C++ Version: 3.4 Platform: Macintosh http://stackoverflow.com/questions/16369912/unable-to-call-a-template-member-function-of-a-template-class-from-another-templ MacOS X Importance: P normal Assigned To: Unassigned Clang Bugs URL: Keywords: Depends on: Blocks: Show dependency tree /graph Reported: 2014-02-27 15:35 CST by Erik Schnetter Modified: 2015-12-10 11:58 CST (History) CC List: 4 users (show) davejohansen dgregor llvm-bugs richard-llvm See Also: Attachments Add an attachment (proposed patch, testcase, etc.) Note https://llvm.org/bugs/show_bug.cgi?id=18995 You need to log in before you can comment on or make changes to this bug. Description Erik Schnetter 2014-02-27 15:35:55 CST I received the following error message for C++ code: {{{ reference to non-static member function must be called static_cast [Bug c++/65188] New: diagnostic: missing: reference to non-static member function must be called From: "jan.kratochvil at redhat dot com" asked 2014-05-04 02:50:41 -0500 Nap 123 ●16 ●22 ●28 [Ubuntu 13.10, Hydro Desktop-Full from source, C++] I am having difficulty setting up callback functions for my ROS Topic subscribers, and would appreciate help. Since all my Topics use the std_msgs::String type, I've defined the class shown below with a generic callback function and an instance variable which identifies the specific Topic. class myCallback { const char * eventtype; public: myCallback(const char * eventType) : eventtype(eventType) {} void generic_callback(const std_msgs::String::ConstPtr& msg) { std::cerr << this->eventtype << " heard: " << msg->data.c_str() << std::endl; } }; For the ROS functionality in my project, I've created a separate class gwrbclass.cpp & gwrbclass.h, which include the myCallback class. In the header file, I define myCallback *callbackList[NUM_EVENT_TYPES] as a private variable. In the implementation, I instantiate the required myCallback objects for each entry in the callbackList and try to bind it to the node's subscriber object as shown below: for (int j=0; jCannot Create A Non-constant Pointer To Member Function