This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50140] New: sorry, unimplemented: cannot expand âT ...â into a fixed-length argument list
- From: "lcid-fire at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 20 Aug 2011 20:37:23 +0000
- Subject: [Bug c++/50140] New: sorry, unimplemented: cannot expand âT ...â into a fixed-length argument list
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50140
Bug #: 50140
Summary: sorry, unimplemented: cannot expand âT ...â into a
fixed-length argument list
Classification: Unclassified
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lcid-fire@gmx.net
Trying to use metaprogramming with variadic templates g++ chokes on the
following code:
template<GLenum One, GLenum... Others>
class Eval
{
public:
bool eval(GLenum value)
{
if( value == One )
return true;
Eval<Others...> recurse();
// Try out the rest
return recurse.eval(value);
};
};
template<>
class Eval
{
public:
bool eval(GLenum value)
{
return false;
};
};
template<GLenum... ValidEnums>
class GLPart
{
protected:
GLPart()
{
};
public:
bool Evaluate(GLenum value)
{
Eval<ValidEnums...> ev();
bool isValid = ev.eval(value);
if( !isValid )
glSetError(GL_INVALID_ENUM);
return isValid;
};
};
which gives the error:
sorry, unimplemented: cannot expand âOthers ...â into a fixed-length argument
list