Does Vector is not supported by VC++ 6.0??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • E. Mark Ping

    #16
    Re: Does Vector is not supported by VC++ 6.0??

    In article <c05k6o$m2o$1@n ews.iucc.ac.il> ,
    Michael Groys <michaelg@alzt. tau.ac.il> wrote:[color=blue]
    >David Harmon wrote:[color=green]
    >> Wrong, no space-filling comment required. Standard solution is
    >> vector<vector<i nt> >
    >>
    >> Naturally, operator>> will not work there.[/color]
    >
    >Just inserting one space doesn't help.
    >Try it if you don't believe.[/color]

    You don't know what you're talking about. And you apparently are too
    stubborn or arrogant to realize that you might be wrong (and in this
    case you *are* wrong).

    This is a known ambiguity of the standard, where any
    A<B<type> > construct will only compile with the two '>' separated,
    typically by whitespace. Refrain from giving advice if your own
    ignorance is greater than the OP.
    --
    Mark Ping
    emarkp@soda.CSU A.Berkeley.EDU

    Comment

    • David Harmon

      #17
      Re: Does Vector is not supported by VC++ 6.0??

      On Sun, 08 Feb 2004 17:21:52 +0200 in comp.lang.c++, Michael Groys
      <michaelg@alzt. tau.ac.il> was alleged to have written:[color=blue]
      >David Harmon wrote:[color=green]
      >> Wrong, no space-filling comment required. Standard solution is
      >> vector<vector<i nt> >[/color]
      >
      >Just inserting one space doesn't help.
      >Try it if you don't believe.[/color]

      Still wrong. Of course I have tried it, many times.
      The issue and the fix are well-known, e.g. recently
      http://groups.google.c om/groups?selm=brl 37f$sud$1@news. apple.com
      http://groups.google.c om/groups?selm=rMY Mb.47226$xy6.11 6719@attbi_s02

      By the way, I notice the poster's error message refers to line 135, and
      he only posted 5 lines of code, therefore he is lying to us about what
      the actual code is that produced the message.

      Comment

      • Michael Groys

        #18
        Re: Does Vector is not supported by VC++ 6.0??



        Michael Mellor wrote:[color=blue]
        > Michael Groys wrote:
        >[color=green]
        >> David Harmon wrote:
        >>[color=darkred]
        >>> On Sun, 08 Feb 2004 16:43:06 +0200 in comp.lang.c++, Michael Groys
        >>> <michaelg@alzt. tau.ac.il> was alleged to have written:
        >>>
        >>>> vector<vector<i nt>> will not work for sure because of
        >>>> ^^
        >>>> and the only solution is to write
        >>>> vector<vector<i nt>/**/>
        >>>
        >>>
        >>> Wrong, no space-filling comment required. Standard solution is
        >>> vector<vector<i nt> >
        >>>
        >>> Naturally, operator>> will not work there.[/color]
        >>
        >>
        >> Just inserting one space doesn't help.
        >> Try it if you don't believe.[/color]
        >
        >
        > Firstly, I assume your entire discussion is about VC++ 6.
        >
        > vector<vector<i nt> > obj;
        >
        > is the normal way to solve the problem. I couldn't imagine anyone would
        > write a compiler in which this does not work. Anyhow, you claim that
        > VC++ 6 does not support the insertion of a space but a quick google
        > search suggests it does.
        >
        > Mike[/color]
        I didn't do any search in Google concerning this problem, but I did
        write programs in VC6 and I got an error.
        Did you try it in VC or just in google?

        Comment

        • David Harmon

          #19
          Re: Does Vector is not supported by VC++ 6.0??

          On Sun, 08 Feb 2004 18:05:35 +0200 in comp.lang.c++, Michael Groys
          <michaelg@alzt. tau.ac.il> was alleged to have written:[color=blue]
          >I didn't do any search in Google concerning this problem, but I did
          >write programs in VC6 and I got an error.[/color]

          Post the code.

          Comment

          • Pete Becker

            #20
            Re: Does Vector is not supported by VC++ 6.0??

            "E. Mark Ping" wrote:[color=blue]
            >
            > This is a known ambiguity of the standard, where any
            > A<B<type> > construct will only compile with the two '>' separated,
            > typically by whitespace.[/color]

            It's not an ambiguity. >> is one token, not two.

            --

            Pete Becker
            Dinkumware, Ltd. (http://www.dinkumware.com)

            Comment

            • Andrew Koenig

              #21
              Re: Does Vector is not supported by VC++ 6.0??


              "Ram Laxman" <ram_laxman@ind ia.com> wrote in message
              news:24812e22.0 402080308.6024a 6d2@posting.goo gle.com...[color=blue]
              > I have used vector in the VC++ compiler. I have included
              >
              > #include <string>
              > #include <algorithm>
              > #include <vector>
              >
              > std::vector<int > field;
              > std::vector <int>::size_typ e i;
              >
              >
              > test.cpp(135) : error C2653: 'std' : is not a class or namespace name
              > error C2143: syntax error : missing ';' before '<'
              > error C2501: 'vector' : missing storage-class or type specifiers
              > error C2143: syntax error : missing ';' before '<'
              > error C2653: 'std' : is not a class or namespace name[/color]

              There are several bugs in VC++ 6.0 that affect programs that use vector and
              related classes.

              Before you do anything else, be sure that the latest service pack for VC++
              6.0 (which I think is Service Pack 4) is installed, as it fixes a number of
              those bugs.

              One bug that is not fixed, and might be related to your problem, is this:

              using std::vector;
              vector<int>::si ze_type i;

              This code should work, but doesn't work in VC++ 6.0; instead, you have to
              say

              std::vector<int >::size_type i;

              I *think*, but am not certain, that even this latter version of the code
              requires Service Pack 4.


              Comment

              • Deming He

                #22
                Re: Does Vector is not supported by VC++ 6.0??

                David Harmon <source@netcom. com> wrote in message
                news:405558e5.8 9961362@news.we st.earthlink.ne t...[color=blue]
                > On Sun, 08 Feb 2004 17:21:52 +0200 in comp.lang.c++, Michael Groys
                > <michaelg@alzt. tau.ac.il> was alleged to have written:[color=green]
                > >David Harmon wrote:[color=darkred]
                > >> Wrong, no space-filling comment required. Standard solution is
                > >> vector<vector<i nt> >[/color]
                > >
                > >Just inserting one space doesn't help.
                > >Try it if you don't believe.[/color]
                >
                > Still wrong. Of course I have tried it, many times.
                > The issue and the fix are well-known, e.g. recently
                > http://groups.google.c om/groups?selm=brl 37f$sud$1@news. apple.com
                > http://groups.google.c om/groups?selm=rMY Mb.47226$xy6.11 6719@attbi_s02
                >
                > By the way, I notice the poster's error message refers to line 135, and
                > he only posted 5 lines of code, therefore he is lying to us about what
                > the actual code is that produced the message.
                >[/color]
                I think you're right on this. The code showed by OP could be very possibly
                not the source of compile errors. In some other place(s) of OP's code,
                std::vector used but <vector> not include'd.


                Comment

                • Mike Wahler

                  #23
                  Re: Does Vector is not supported by VC++ 6.0??


                  "Michael Groys" <michaelg@alzt. tau.ac.il> wrote in message
                  news:c05k6o$m2o $1@news.iucc.ac .il...[color=blue]
                  >
                  >
                  > David Harmon wrote:[color=green]
                  > > On Sun, 08 Feb 2004 16:43:06 +0200 in comp.lang.c++, Michael Groys
                  > > <michaelg@alzt. tau.ac.il> was alleged to have written:
                  > >[color=darkred]
                  > >>vector<vector <int>> will not work for sure because of
                  > >> ^^
                  > >>and the only solution is to write
                  > >>vector<vector <int>/**/>[/color]
                  > >
                  > >
                  > > Wrong, no space-filling comment required. Standard solution is
                  > > vector<vector<i nt> >
                  > >
                  > > Naturally, operator>> will not work there.[/color]
                  >
                  > Just inserting one space doesn't help.
                  > Try it if you don't believe.[/color]

                  It works just fine with VC6, as does the OP's posted code.

                  -Mike


                  Comment

                  • Mike Wahler

                    #24
                    Re: Does Vector is not supported by VC++ 6.0??


                    "Michael Groys" <michaelg@alzt. tau.ac.il> wrote in message
                    news:c05moo$oau $1@news.iucc.ac .il...[color=blue][color=green]
                    > > vector<vector<i nt> > obj;
                    > >
                    > > is the normal way to solve the problem. I couldn't imagine anyone would
                    > > write a compiler in which this does not work. Anyhow, you claim that
                    > > VC++ 6 does not support the insertion of a space but a quick google
                    > > search suggests it does.
                    > >
                    > > Mike[/color]
                    > I didn't do any search in Google concerning this problem, but I did
                    > write programs in VC6 and I got an error.[/color]

                    OK post the *exact* code you tried, and the exact text of any error
                    messages.

                    -Mike


                    Comment

                    • Mike Wahler

                      #25
                      Re: Does Vector is not supported by VC++ 6.0??


                      "E. Mark Ping" <emarkp@soda.cs ua.berkeley.edu > wrote in message
                      news:c05mip$2pa a$1@agate.berke ley.edu...[color=blue]
                      > In article <c05k6o$m2o$1@n ews.iucc.ac.il> ,
                      > Michael Groys <michaelg@alzt. tau.ac.il> wrote:[color=green]
                      > >David Harmon wrote:[color=darkred]
                      > >> Wrong, no space-filling comment required. Standard solution is
                      > >> vector<vector<i nt> >
                      > >>
                      > >> Naturally, operator>> will not work there.[/color]
                      > >
                      > >Just inserting one space doesn't help.
                      > >Try it if you don't believe.[/color]
                      >
                      > You don't know what you're talking about. And you apparently are too
                      > stubborn or arrogant to realize that you might be wrong (and in this
                      > case you *are* wrong).
                      >
                      > This is a known ambiguity of the standard,[/color]


                      What ambiguity?
                      [color=blue]
                      > where any
                      > A<B<type> > construct will only compile with the two '>' separated,
                      > typically by whitespace.[/color]


                      That's the *only* way to 'separate' them.

                      '>' and '>>' are two separate tokens.
                      [color=blue]
                      > Refrain from giving advice if your own
                      > ignorance is greater than the OP.[/color]

                      :-)

                      -Mike


                      Comment

                      • Mike Wahler

                        #26
                        Re: Does Vector is not supported by VC++ 6.0??

                        "Andrew Koenig" <ark@acm.org> wrote in message
                        news:r5uVb.1987 04$6y6.3998678@ bgtnsc05-news.ops.worldn et.att.net...[color=blue]
                        >
                        > There are several bugs in VC++ 6.0 that affect programs that use vector[/color]
                        and[color=blue]
                        > related classes.
                        >
                        > Before you do anything else, be sure that the latest service pack for VC++
                        > 6.0 (which I think is Service Pack 4) is installed, as it fixes a number[/color]
                        of[color=blue]
                        > those bugs.
                        >
                        > One bug that is not fixed, and might be related to your problem, is this:
                        >
                        > using std::vector;
                        > vector<int>::si ze_type i;
                        >
                        > This code should work, but doesn't work in VC++ 6.0; instead, you have to
                        > say
                        >
                        > std::vector<int >::size_type i;[/color]

                        Yes, I've run into that myself.
                        [color=blue]
                        > I *think*, but am not certain, that even this latter version of the code
                        > requires Service Pack 4.[/color]

                        <OT info>
                        Last Service Pack for VC6 is SP5, dowloadable from msdn.microsoft. com,
                        or can be obtained on CD for a nominal shipping fee.
                        </OT info>

                        -Mike


                        Comment

                        • David Harmon

                          #27
                          Re: Does Vector is not supported by VC++ 6.0??

                          On Sun, 08 Feb 2004 17:53:18 GMT in comp.lang.c++, "Deming He"
                          <deming.he@worl dnet.att.net> was alleged to have written:[color=blue][color=green]
                          >>[/color]
                          >I think you're right on this. The code showed by OP could be very possibly
                          >not the source of compile errors. In some other place(s) of OP's code,
                          >std::vector used but <vector> not include'd.[/color]

                          Missing semicolon on preceding line, who knows? Could be anything.

                          Comment

                          • E. Mark Ping

                            #28
                            Re: Does Vector is not supported by VC++ 6.0??

                            In article <402668E7.5F477 78A@acm.org>,
                            Pete Becker <petebecker@acm .org> wrote:[color=blue]
                            >"E. Mark Ping" wrote:[color=green]
                            >>
                            >> This is a known ambiguity of the standard, where any
                            >> A<B<type> > construct will only compile with the two '>' separated,
                            >> typically by whitespace.[/color]
                            >
                            >It's not an ambiguity. >> is one token, not two.[/color]

                            Poor wording on my part--I was aware that the space was necessary to
                            make it two tokens instead of one. Thanks for the correction.
                            --
                            Mark Ping
                            emarkp@soda.CSU A.Berkeley.EDU

                            Comment

                            • Ricky Lung

                              #29
                              Re: Does Vector is not supported by VC++ 6.0??

                              You have a "space" between std::vector and <int>
                              std::vector <int>::size_typ e i;

                              "Ram Laxman" <ram_laxman@ind ia.com> wrote in message
                              news:24812e22.0 402080308.6024a 6d2@posting.goo gle.com...[color=blue]
                              > I have used vector in the VC++ compiler. I have included
                              >
                              > #include <string>
                              > #include <algorithm>
                              > #include <vector>
                              >
                              > std::vector<int > field;
                              > std::vector <int>::size_typ e i;
                              >
                              >
                              > test.cpp(135) : error C2653: 'std' : is not a class or namespace name
                              > error C2143: syntax error : missing ';' before '<'
                              > error C2501: 'vector' : missing storage-class or type specifiers
                              > error C2143: syntax error : missing ';' before '<'
                              > error C2653: 'std' : is not a class or namespace name
                              >
                              >
                              > Does anybody know what is the problem??
                              >
                              > Regards
                              > Bubunia[/color]


                              ~ Let us linux ~


                              -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
                              http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
                              -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

                              Comment

                              • Christoph Rabel

                                #30
                                Re: Does Vector is not supported by VC++ 6.0??

                                Ricky Lung wrote:[color=blue]
                                > You have a "space" between std::vector and <int>
                                > std::vector <int>::size_typ e i;[/color]

                                No. Spaces dont matter.

                                std :: vector <int> :: size_type t;

                                compiles fine with VC6.

                                And please dont toppost.

                                Christoph

                                Comment

                                Working...