Click here to Skip to main content
15,073,282 members

Comments by jackyxinli (Top 4 by date)

jackyxinli 6-Jan-19 22:33pm View
   
Thanks a lot. I find an article also in stackoverflow[https://stackoverflow.com/questions/12676190/how-to-call-a-template-member-function]

YES, template is more complicated than normal syntax in C++, so obscurity.
jackyxinli 2-Jan-19 19:30pm View
   
Thank you first, I also find defination of function in boost library. May I ask you about this syntax where can I find in C++ specification?
jackyxinli 28-Dec-18 20:43pm View
   
I tried command like blow:
g++ -Wall -std=c++11 -o delegate delegate.cpp

or
g++ -Wall -std=c++0x -o delegate delegate.cpp

do not work
jackyxinli 28-Dec-18 19:43pm View
   
$ g++ -Wall -std=c++11 -o delegate delegate.cpp
delegate.cpp: In lambda function:
delegate.cpp:77:26: error: expected primary-expression before '(' token
auto _fun = f.target<R(*)(Args...)>();
^
delegate.cpp:77:28: error: expected primary-expression before ')' token
auto _fun = f.target<R(*)(Args...)>();
^
delegate.cpp:77:34: error: expected primary-expression before '...' token
auto _fun = f.target<R(*)(Args...)>();
^~~
delegate.cpp:77:40: error: expected primary-expression before ')' token
auto _fun = f.target<R(*)(Args...)>();
^
delegate.cpp: In lambda function:
delegate.cpp:97:57: error: expected primary-expression before '>' token
auto _fun = f.target<delegate_class_mem<C, R, Args...>>();
^~
delegate.cpp:97:60: error: expected primary-expression before ')' token
auto _fun = f.target<delegate_class_mem<C, R, Args...>>();
^
delegate.cpp: In member function 'delegate<R(Args ...)>::this_type& delegate<R(Args ...)>::operator+=(delegate<R(Args ...)>::func_type)':
delegate.cpp:117:31: error: expected primary-expression before '(' token
auto _func = (*it).target<R(*)(Args...)>();
^
delegate.cpp:117:33: error: expected primary-expression before ')' token
auto _func = (*it).target<R(*)(Args...)>();
^
delegate.cpp:117:39: error: expected primary-expression before '...' token
auto _func = (*it).target<R(*)(Args...)>();
^~~
delegate.cpp:117:45: error: expected primary-expression before ')' token
auto _func = (*it).target<R(*)(Args...)>();
^