[Bug c++/50140] New: sorry, unimplemented: cannot expand ‘T ?=...=?UTF-8?Q?’ into a fixed-length argument list
lcid-fire at gmx dot net
gcc-bugzilla@gcc.gnu.org
Sat Aug 20 20:52:00 GMT 2011
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
More information about the Gcc-bugs
mailing list