Overview
Features
Download
Documentation
Community
Add-Ons & Services

Tuples and Templates

Please post support and help requests here.

Tuples and Templates

Postby bird » 19 Oct 2008, 06:19

^
Code: Select all

template
void func( T tuple)
{
   tuple.get<0>();
}

^
Can anyone tell me why this won't compile on the Mac?
The error message is "expected primary-expression before ")" token.
Google gets a few hits but no solution that works for me.
Compiles fine with VC
TIA -Steve
bird
 
Posts: 19
Joined: 22 Sep 2007, 16:57

Re: Tuples and Templates

Postby bird » 19 Oct 2008, 07:52

I found the solution:
link

If you add "template" before "get()" , then gcc complies without error.
-Steve

^
Code: Select all

template
void func( T tuple )
{
tuple.template get();
}

^
bird
 
Posts: 19
Joined: 22 Sep 2007, 16:57


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests