When I compile c++ code, it has the following error
"../simple.cpp", line 25: error #796: explicit specialization of function "tut::test_object<Data>::test<n>() [with Data=tut::test, n=1]" must precede its first use
How can I fix?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
The specialization of the function template tut::test_object<Data>::test<n> must appear before any calls to that function. I presume this is a complete specialization (also known as a total specialization), and thus it begins with "template <>". This specialization must appear before any call to that function.
Thanks and regards,
-George
Thank you for your reply.
The codes are one part of the big platform.There are lots of these definitions.And the codes can be built in Linux and Windows.
So, I would like to know, whether the CCSv5 has some options to not use the explicit template function specialization.
Thanks
yd fang said:whether the CCSv5 has some options to not use the explicit template function specialization
No. That is a fundamental part of templates in C++.
My guess is that you have not configured your build correctly. Some -D option is missing, or something like that.
Thanks and regards,
-George