A
Asfand Yar Qazi
Hi,
I'm testing the gcc-3.4 branch (built with 'make profilebootstrap' sped
up compiles by a massive 10%!)
Its got better conformance to the C++ Standard (hence this is not an OT
post.) I'm having trouble figuring out what it wants me to do. Here's
some code, and the error messages generated.
namespace NA
{
namespace N1
{
template<typename SomeT>
class Tmp1
{
};
template<typename T1, typename T2 = Tmp1<T1> >
class C1
{
public:
template<unsigned i>
class C2
{
};
};
};
};
namespace NA
{
namespace N2
{
template<typename B>
B
a_func(const N1::C1<B>::template C2<3>& arg)
{
}
};
};
int
main()
{
using namespace NA;
using namespace N1;
N1::C1<double>::C2<3> v;
N2::a_func<double>(v);
return 0;
}
one.cc:40: error: expected unqualified-id before '&' token
one.cc:40: error: expected `,' or `...' before '&' token
one.cc:41: error: ISO C++ forbids declaration of `parameter' with no type
one.cc: In function `int main()':
one.cc:55: error: cannot convert `NA::N1::C1<double,
NA::N1::Tmp1<double> >::C2<3u>' to `int' for argument `1' to `B
NA::N2::a_func(int) [with B = double]'
I know its some problem with the 'a_func ....' line.
Before it read:
a_func(const N1::C1<B>::C2<3>& arg)
and gave the error message:
one.cc:40: error: non-template `C2' used as template
one.cc:40: error: (use `NA::N1::C1<B, NA::N1::Tmp1<T1> >::template C2'
to indicate that it is a template)
one.cc:40: error: expected unqualified-id before ')' token
Ideas? I'm finally getting my SSE-optimised templated expression using
vector-maths library off the ground now that GCC isn't full of
template-parsing bugs, but it seems that I can't figure out the correct
behaviour anyway
Thanks,
Asfand Yar
I'm testing the gcc-3.4 branch (built with 'make profilebootstrap' sped
up compiles by a massive 10%!)
Its got better conformance to the C++ Standard (hence this is not an OT
post.) I'm having trouble figuring out what it wants me to do. Here's
some code, and the error messages generated.
namespace NA
{
namespace N1
{
template<typename SomeT>
class Tmp1
{
};
template<typename T1, typename T2 = Tmp1<T1> >
class C1
{
public:
template<unsigned i>
class C2
{
};
};
};
};
namespace NA
{
namespace N2
{
template<typename B>
B
a_func(const N1::C1<B>::template C2<3>& arg)
{
}
};
};
int
main()
{
using namespace NA;
using namespace N1;
N1::C1<double>::C2<3> v;
N2::a_func<double>(v);
return 0;
}
one.cc:40: error: expected unqualified-id before '&' token
one.cc:40: error: expected `,' or `...' before '&' token
one.cc:41: error: ISO C++ forbids declaration of `parameter' with no type
one.cc: In function `int main()':
one.cc:55: error: cannot convert `NA::N1::C1<double,
NA::N1::Tmp1<double> >::C2<3u>' to `int' for argument `1' to `B
NA::N2::a_func(int) [with B = double]'
I know its some problem with the 'a_func ....' line.
Before it read:
a_func(const N1::C1<B>::C2<3>& arg)
and gave the error message:
one.cc:40: error: non-template `C2' used as template
one.cc:40: error: (use `NA::N1::C1<B, NA::N1::Tmp1<T1> >::template C2'
to indicate that it is a template)
one.cc:40: error: expected unqualified-id before ')' token
Ideas? I'm finally getting my SSE-optimised templated expression using
vector-maths library off the ground now that GCC isn't full of
template-parsing bugs, but it seems that I can't figure out the correct
behaviour anyway
Thanks,
Asfand Yar