Using operator() in any section of a DRAKON project (version 1.27 RC1) will generate an error:
In file included from /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/main.h:10:0, from main.cpp:5: /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/CTB_Print.h:12:13: error: expected type-specifier before ‘)’ token operator)(const T &RCT_t); ^ /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/CTB_Print.h:23:23: error: expected type-specifier before ‘)’ token CTB_Print<T>::operator)(const T &RCT_t) ^ main.cpp: In function ‘int main(int, char**)’: main.cpp:41:20: error: no match for call to ‘(CTB_Print<short unsigned int>) (T_USHORT&)’ { O_DoPrint(i);
The temporary fix is to insert a blank between the keyword "operator" and the (). In the attached example the issue can be reproduced by editing the CTB_Print.drn project and replacing "operator ()" with "operator()" in the project description. Just extract the project and execute the script "run.drk" from the DRAKON sub-directory.
19.11-A_function_object.tar.gz
Using operator() in any section of a DRAKON project (version 1.27 RC1) will generate an error:
In file included from /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/main.h:10:0, from main.cpp:5: /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/CTB_Print.h:12:13: error: expected type-specifier before ‘)’ token operator)(const T &RCT_t); ^ /home/work/HOWTOs/HOWTO-programming/SAMS-projects/19/19.11-A_function_object/prj/inc/CTB_Print.h:23:23: error: expected type-specifier before ‘)’ token CTB_Print<T>::operator)(const T &RCT_t) ^ main.cpp: In function ‘int main(int, char**)’: main.cpp:41:20: error: no match for call to ‘(CTB_Print<short unsigned int>) (T_USHORT&)’ { O_DoPrint(i);
The temporary fix is to insert a blank between the keyword "operator" and the (). In the attached example the issue can be reproduced by editing the CTB_Print.drn project and replacing "operator ()" with "operator()" in the project description. Just extract the project and execute the script "run.drk" from the DRAKON sub-directory. 19.11-A_function_object.tar.gz