Compiler: Sun Studio 10 on Unix (Sun Solaris)
Expand|Select|Wrap|Line Numbers
- #include<iostream>
- #include<set>
- using namespace std;
- int main()
- {
- struct product
- {
- int id;
- string desc;
- double amt;
- } prdt;
- prdt.id = 1234;
- prdt.desc = "Credit Card";
- prdt.amt = 1000.00 ;
- cout << " This is a program to test set conatainer. " << endl
- << " Product ID is: " << prdt.id
- << ", Product Desc is : " << prdt.desc
- << ", Credit Card Limit is : " << prdt.amt << endl ;
- [COLOR="DarkRed"]// Test program for 'set' container with a struct
- typedef std::set< product, std::less< int > > product_set;[/COLOR]
- return 0;
- }
Error Message:[COLOR="DarkRed"]"testSet.c", line 26: Error: The local type "product" cannot be used as a template argument.
"/opt/SunStudio10/SUNWspro/prod/include/CC/Cstd/./set", line 83: Error: The local type "product" cannot be used as a template argument.[/COLOR]