template <class T>
struct ABC
{
typedef typename T* pT;
};
int main(){}
The above piece of code gives errors
expected nested-name-specifier before 'T'
expected ';' before '*' token
What is wrong with the code sample?
500 pages is 250000 words single-spaced or 125000 words double-spaced. Typical documents that are 500 pages or more include full-length novels. A typical single-spaced page is 500 words long. It will take approximately 833 minutes to read 500 pages.
The <template> tag is used as a container to hold some HTML content hidden from the user when the page loads. The content inside <template> can be rendered later with a JavaScript. You can use the <template> tag if you have some HTML code you want to use over and over again, but not until you ask for it.
The keyword typename
is forbidden on unqualified names (those not preceded by ::
), even if they are dependent.
C++03 [Section 14.6/5
] says
The keyword typename shall be applied only to qualified names, but those names need not be dependent.
pt
is dependent on T but that doesn't matter (in this context).
Remove typename
to make your code compile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With