template issue
805962Oct 16 2010 — edited Oct 19 2010Following construction perfectly compiles with g++:
ev++.h file:
...
template<class ev_watcher, class watcher>
struct base : ev_watcher
{
...
// method callback
template<class K, void (K::* method)(watcher &w, int)>
void set (K *object) throw ()
{
...
}
...
}
Foo.cpp file:
...
ev::io watcher_;
watcher_.set<CFoo, &CFoo::FooCb> (this);
...
However, with Sun's CC I get following error:
Error: Could not find a match for ev::base<ev_io, ev::io>::set(CFoo*) needed in CFoo::StartWatch()
Seems that CC can't recognize non-trivial template param (K::* method).
Please help.
UPD: found almost same issue here - http://forums.sun.com/thread.jspa?threadID=5444109&tstart=15.
My version is Oracle Solaris Studio 12.2 (Build 201008131055), and it up to date.
Edited by: 802959 on Oct 16, 2010 10:46 AM
Edited by: 802959 on Oct 16, 2010 2:50 PM
Edited by: 802959 on Oct 16, 2010 2:51 PM