Solved

too many template arguments

Posted on 2003-11-19
13
1,812 Views
Last Modified: 2013-12-14
i get some error like d:\Programs\VS NET\Vc7\include\resiter1.hh(29): error C2977: 'std::reverse_iterator' : too many template arguments then i try to use mysql++ made for vc++ 6.0 in visual .net

the code line is

  typedef iterator   const_iterator; //:
  typedef const std::reverse_iterator< iterator, ValueType >       reverse_iterator; //:
  typedef const std::reverse_iterator< const_iterator, ValueType >  const_reverse_iterator; //:
0
Comment
Question by:-Mihai-
  • 6
  • 5
13 Comments
 

Author Comment

by:-Mihai-
ID: 9784041
full error line :

d:\Programs\VS NET\Vc7\include\resiter1.hh(29): error C2977: 'std::reverse_iterator' : too many template arguments
        d:\Programs\VS NET\Vc7\include\xutility(723) : see declaration of 'std::reverse_iterator'
        d:\Programs\VS NET\Vc7\include\resiter1.hh(52) : see reference to class template instantiation 'const_subscript_container<OnType,ValueType,ReturnType,SizeType,DiffType>' being compiled
0
 

Expert Comment

by:adam_g
ID: 9784344
could you send post the section of your code that you think is causing this error?
0
 
LVL 22

Expert Comment

by:cookre
ID: 9784540
They've changed it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vclrfreverse_iteratortypenamechanges.asp
======
The names for some of the types defined by the Standard C++ Library reverse_iterator class have changed. Also, there are different template arguments for this class.

The following sample compiled in Visual C++ 6.0, but fails in the current version:

#include <iterator>
#include <vector>
typedef std::iterator<std::random_access_iterator_tag, char, int> random_it;

int main( )
{
   char c;
   
   // too many template args for VC7
   typedef std::reverse_iterator< random_it, char, char&, char *, int > rev_it;
   rev_it::reference_type x = c;
   rev_it::pointer_type y = 0;
   rev_it::iter_type z;

   /*
   // try the following code instead
   typedef std::reverse_iterator< random_it > rev_it;
   rev_it::reference a = c;
   rev_it::pointer b = 0;
   rev_it::iterator_type c1;
   */
}
=====

Here's the new one:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrf_iterator_Reverseiterator_class.asp
=====
Standard C++ Library Reference  

reverse_iterator Class
The template class is an iterator adaptor that describes a reverse iterator object that behaves like a random-access or bidirectional iterator, only in reverse. It enables the backward traversal of a range.

template <class Iterator>
Parameter
Iterator
The type that represents the iterator to be adapted to operate in reverse.
=====
0
 

Author Comment

by:-Mihai-
ID: 9790452
can you modify the code i pasted to work in visual .net ?
0
 
LVL 22

Expert Comment

by:cookre
ID: 9790837
Not without the source that shows how it's being used...
0
 

Author Comment

by:-Mihai-
ID: 9813176
well i use mysql++ api for visual c 6.0 (there its not a version for net too :<)
http://www.mysql.com/downloads/api-mysql++.html

could you please look on it ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:cookre
ID: 9813351
I just downloaded it from here:
http://www.mysql.com/get/Downloads/mysql++/mysql++-1.7.9.tar.gz/from/pick
and noted that sqlplusint\resiter1.hh has the correct usage.

Perhaps that a more recent version than the one you're using?



0
 

Author Comment

by:-Mihai-
ID: 9827810
You mean you had no problems with that API in visual .net ?

well, i see that you downloaded a version for linux ...
0
 
LVL 22

Accepted Solution

by:
cookre earned 500 total points
ID: 9841173
Oops, I did get the wrong one, didn't I.

Well, I compared the two sets of .hh files and found no other references to reverse_iterator, so, I'd be tempted to just replace the VC definition with the Linux definition:
0
 
LVL 22

Expert Comment

by:cookre
ID: 9841184
There are also differences in subscript_iterator too, but, like the other one, there were no references to it from any other .hh in either of the to flavors, so, see what happens if you just replace the VC resiter.hh with the linux one. From that archive, it's in directory 'sqlplusint'.
0
 
LVL 22

Expert Comment

by:cookre
ID: 9889007
Having any success?
0
 

Author Comment

by:-Mihai-
ID: 9973904
Nope, can you modify them for me please ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 91
Image decoding from Camera 3 72
This code tracks birthdays 3 59
simplest php form 3 59
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now