Discussion:
Tempates. Compiler error
(too old to reply)
Andriy
2008-05-05 15:22:06 UTC
Permalink
Hello
Maybe someone knows the reason of the next compiler error notification.

template <typename T>
class TestA
{
public:
template <typename C>
void f();
};

template <>
template <typename C>
void TestA<double>::f()
{}

[BCC32 Error] E2299 Cannot generate template specialization from 'TestA<double>::f<C>()'
Chris Uzdavinis (TeamB)
2008-05-05 16:21:47 UTC
Permalink
Post by Andriy
Hello
Maybe someone knows the reason of the next compiler error notification.
template <typename T>
class TestA
{
template <typename C>
void f();
};
template <>
template <typename C>
void TestA<double>::f()
{}
[BCC32 Error] E2299 Cannot generate template specialization from 'TestA<double>::f<C>()'
For completeness, which compiler version are you using?

I don't think anything is inherently wrong with your code, and think
it's probably a limitation of the compiler. Perhaps there is a
workaround, but I can't experiment right now to (try to) find one.
--
Chris (TeamB);
Andriy
2008-05-06 13:12:09 UTC
Permalink
Post by Chris Uzdavinis (TeamB)
Post by Andriy
Hello
Maybe someone knows the reason of the next compiler error notification.
template <typename T>
class TestA
{
template <typename C>
void f();
};
template <>
template <typename C>
void TestA<double>::f()
{}
[BCC32 Error] E2299 Cannot generate template specialization from 'TestA<double>::f<C>()'
For completeness, which compiler version are you using?
I don't think anything is inherently wrong with your code, and think
it's probably a limitation of the compiler. Perhaps there is a
workaround, but I can't experiment right now to (try to) find one.
--
Chris (TeamB);
CodeGear™ C++Builder® 2007 R2 Version 11.0.2987.10779
Chris Uzdavinis (TeamB)
2008-05-06 17:49:01 UTC
Permalink
CodeGear C++Builder 2007 R2 Version 11.0.2987.10779
Well, that's not exactly an old compiler. Would you mind submitting a
bug report on this in quality-central?
--
Chris (TeamB);
Alex Bakaev [TeamB]
2008-05-06 18:24:08 UTC
Permalink
Post by Chris Uzdavinis (TeamB)
Well, that's not exactly an old compiler. Would you mind submitting a
bug report on this in quality-central?
I will submit a report.
Leo Siefert
2008-05-07 11:47:10 UTC
Permalink
Post by Alex Bakaev [TeamB]
I will submit a report.
Report No: 61818 Status: Open
Template partial specialization fails
http://qc.codegear.com/wc/qcmain.aspx?d=61818
QCWIN:Defect_No=61818

- Leo

Thomas Maeder [TeamB]
2008-05-05 16:24:12 UTC
Permalink
Post by Andriy
Maybe someone knows the reason of the next compiler error notification.
Looks like a compiler bug.
Post by Andriy
template <typename T>
class TestA
{
template <typename C>
void f();
};
template <>
template <typename C>
void TestA<double>::f()
{}
[BCC32 Error] E2299 Cannot generate template specialization from 'TestA<double>::f<C>()'
What version are you using?
Andriy
2008-05-06 09:01:16 UTC
Permalink
Post by Thomas Maeder [TeamB]
What version are you using?
CodeGear™ C++Builder® 2007 R2 Version 11.0.2987.10779
Loading...