Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

template issue

805962Oct 16 2010 — edited Oct 19 2010
Following 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 16 2010
Added on Oct 16 2010
4 comments
174 views