Template Arguments Required? 
Author Message
 Template Arguments Required?

Using the Visual Studio 2003 C++ compiler

I have the following 2 lines.

typedef set<string, less<string> > type_some_set;
typedef map<char, type_some_set,  less<char> > type_char_to_some_set;

The compiler errors the second line complaining about required template
arguments missing
from type_some_set.

I tried
typedef map<char, type_some_set<set>, less<char> > type_char_to_some_set;
and
typedef map<char, type_some_set<set<string> >, less<char> >
type_char_to_some_set;

but neither worked.   What arguments should I be giving to type_some_set ?

Thanks
Jim



Sat, 17 Dec 2005 00:16:17 GMT  
 Template Arguments Required?

Quote:
> Using the Visual Studio 2003 C++ compiler

> I have the following 2 lines.

> typedef set<string, less<string> > type_some_set;
> typedef map<char, type_some_set,  less<char> > type_char_to_some_set;

> The compiler errors the second line complaining about required
template
> arguments missing
> from type_some_set.

This program compiles on VC7.1

#include <set>
#include <map>
#include <string>
using namespace std;

typedef set<string, less<string> > type_some_set;
typedef map<char, type_some_set,  less<char> > type_char_to_some_set;

int main()
{
    type_char_to_some_set a;
    return 0;

Quote:
}

Show a small complete compilable program that reproduces the problem. Do
you maybe fail to include <string> ?
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sat, 17 Dec 2005 00:27:36 GMT  
 Template Arguments Required?
Yes, forgot to include <string>.

Thanks Again.
Jim


Quote:


> > Using the Visual Studio 2003 C++ compiler

> > I have the following 2 lines.

> > typedef set<string, less<string> > type_some_set;
> > typedef map<char, type_some_set,  less<char> > type_char_to_some_set;

> > The compiler errors the second line complaining about required
> template
> > arguments missing
> > from type_some_set.

> This program compiles on VC7.1

> #include <set>
> #include <map>
> #include <string>
> using namespace std;

> typedef set<string, less<string> > type_some_set;
> typedef map<char, type_some_set,  less<char> > type_char_to_some_set;

> int main()
> {
>     type_char_to_some_set a;
>     return 0;
> }

> Show a small complete compilable program that reproduces the problem. Do
> you maybe fail to include <string> ?
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



Sat, 17 Dec 2005 03:06:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. template arguments used within a template function - how?

2. Template parameter conflicts with typedef in template argument

3. explicit template arguments to function templates

4. error C2955: 'Pointer' : use of class template requires template argument list

5. (THE simplest question ever) char[] when the required argument is a char *

6. Declaring class member variables that require a constructor argument

7. how to use MFC to automate Word and run a macro that requires argument(s)

8. typedef with template arguments...

9. Template Default argument lookup

10. template argument array size interpreted as 0

11. Template argument dependant default parameter

12. Default template arguments

 

 
Powered by phpBB® Forum Software