473,513 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

too few template-parameter-lists


#include <iostream>

#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>

using namespace std ;
using namespace boost ;

template <typename numericTypes>
struct evalThis
{
void operator()()
{
typedef mpl::find<numericTypes, char>::type iter ; //
ERROR : error: too few template-parameter-lists
}
} ;

int main()
{
typedef mpl::vector<int, float, char, double, long>
myNumericTypes ;

evalThis<myNumericTypesmyObj ;
myObj.operator()() ;

return 0 ;
}
Nov 18 '08 #1
2 13250
Kaushal wrote:
#include <iostream>

#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>

using namespace std ;
using namespace boost ;

template <typename numericTypes>
struct evalThis
{
void operator()()
{
typedef mpl::find<numericTypes, char>::type iter ; //
ERROR : error: too few template-parameter-lists
WTH is 'mpl::find'? How is it defined?
}
} ;

int main()
{
typedef mpl::vector<int, float, char, double, long>
myNumericTypes ;

evalThis<myNumericTypesmyObj ;
myObj.operator()() ;

return 0 ;
}
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Nov 18 '08 #2
On Nov 18, 1:13 pm, Kaushal <kausha...@gmail.comwrote:
[...]
// ERROR : error: too few template-parameter-lists
typedef mpl::find<numericTypes, char>::type iter;

It's just another C++ wart: the problem is that
mpl::find<numericTypes, char>::type could be a value
or a type, depending on the template arguments.
The language assumes it's a value, so what you've
got there would be like saying:

struct Person { string name; };
...
typedef Person::name iter;

where name is obviously a value and not a type.

The solution is to explicitly tell the compiler that it's
a type with "typename":

typedef typename mpl::find<numericTypes, char>::type iter ;

You can read more about the issue here:

http://www.comeaucomputing.com/techt...ates/#typename

Cheers,
Sean

PS: the previous post asking how the hell mpl::find is defined is
this newsgroup's surprising vernacular for telling you that your
post is off-topic. You might have a friendlier reception
on a Boost mailing list.
Nov 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3334
by: Patrick Kowalzick | last post by:
Dear all, I have a question about default template parameters. I want to have a second template parameter which as a default parameter, but depends on the first one (see below). Is something...
31
3442
by: nikola | last post by:
Hi all, I was working with a simple function template to find the min of two values. But since I would like the two values to be different (type) I dont know what kind of value (type) it will...
5
2157
by: Gianni Mariani | last post by:
The spirit of this arguably pointless exercise, is that the numeric_limits<T> class could be replaced with a totally generic template of compile-time, template computed constants. The problem is...
11
3570
by: cyberdave | last post by:
Someone please help me! I have a template class like this: -------------------------------------------------- template<typename T> class List { public:
2
1995
by: Rudy Ray Moore | last post by:
Whenever I get any error with Vc++7.1/.net/2003, it is followed by huge ammounts of "template assistance" error messaging referencing template code (MTL) that has nothing to do with the error. ...
2
4493
by: Alfonso Morra | last post by:
I have a class declared as ff: class __declspec(dllexport) A { public: A() ; A(const A&) A& operator=(const A&) ; ~A() ; void doThis(void) ;
19
7888
by: aaragon | last post by:
Hi everyone. A very simple question. I would like to know what is better in terms of performance. I want to use a simple function to obtain the minimum of two values. One way could be using a...
3
3739
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
9
3460
by: Leo jay | last post by:
i'd like to implement a class template to convert binary numbers to decimal at compile time. and my test cases are: BOOST_STATIC_ASSERT((bin<1111,1111,1111,1111>::value == 65535));...
1
4444
by: matz2k | last post by:
I've got a big problem with the CSS layout which I've produced with Photoshop/Dreamweaver especially for my ebay auctions. This is what it looks like...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.