<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: STL example compile errors in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909237#M32378</link>
    <description>Bob,&lt;BR /&gt;&lt;BR /&gt;  Note that the error message says the operand type is "const state". &lt;BR /&gt;&lt;BR /&gt;  If you change the code defining the operator to:&lt;BR /&gt;&lt;BR /&gt;ostream &amp;amp; operator&amp;lt;&amp;lt;(ostream &amp;amp;s, const state &amp;amp;o)&lt;BR /&gt;&lt;BR /&gt;  the NOMATOPRFUN error goes away, but you then get a complaint about get_name and get_capital. Removing those references from the operator, I can get your program to compile and run, but obviously I don't see the names.&lt;BR /&gt;&lt;BR /&gt;  So, it looks like this is something to do with overly zealous type checking by the compiler, distinuishing between a constant and variable? &lt;BR /&gt;&lt;BR /&gt;  I can't see a reason why the compiler would think that *p refers to a constant. &lt;BR /&gt;&lt;BR /&gt;  If that doesn't help, please log a case with your local customer support centre.&lt;BR /&gt;&lt;BR /&gt;  (personally I subscribe to the school of thought that C++ was a huge joke played on the programmer community by Bjarne Stroustrup)</description>
    <pubDate>Mon, 27 Jun 2005 16:30:28 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2005-06-27T16:30:28Z</dc:date>
    <item>
      <title>STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909234#M32375</link>
      <description>The attached file contains example C++ code that runs fine on an Alpha running Compaq C++ V6.3-020 for OpenVMS Alpha V7.2,  but on another machine running Compaq C++ V6.3-020 for OpenVMS Alpha V7.2 I get the following:&lt;BR /&gt;"$ cxx stl_set2.cxx&lt;BR /&gt;&lt;BR /&gt;    cout &amp;lt;&amp;lt; *p;&lt;BR /&gt;.........^&lt;BR /&gt;%CXX-E-NOMATOPRFUN, no operator "&amp;lt;&amp;lt;" matches these operands&lt;BR /&gt;            operand types are: ostream_withassign &amp;lt;&amp;lt; const state&lt;BR /&gt;at line number 62 in file GLORIA$DKA300:[PROGRAM.WILLIAMS_R]STL_SET2.CXX;1&lt;BR /&gt;&lt;BR /&gt;    cout &amp;lt;&amp;lt; *p;&lt;BR /&gt;.........^&lt;BR /&gt;%CXX-E-NOMATOPRFUN, no operator "&amp;lt;&amp;lt;" matches these operands&lt;BR /&gt;            operand types are: ostream_withassign &amp;lt;&amp;lt; const state&lt;BR /&gt;at line number 72 in file GLORIA$DKA300:[PROGRAM.WILLIAMS_R]STL_SET2.CXX;1&lt;BR /&gt;&lt;BR /&gt;%CXX-I-MESSAGE, 2 errors detected in the compilation of "GLORIA$DKA300:[PROGRAM.WILLIAMS_R]STL_SET2.CXX;1".&lt;BR /&gt;&lt;BR /&gt;anybody got any clues? Thanks.</description>
      <pubDate>Sun, 26 Jun 2005 21:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909234#M32375</guid>
      <dc:creator>Bob Williams_5</dc:creator>
      <dc:date>2005-06-26T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909235#M32376</link>
      <description>Bob,&lt;BR /&gt;&lt;BR /&gt;  This looks completely plausible and reasonable to me. There is no "&amp;lt;&amp;lt;" operator defined for the operand type "state". What are you expecting it to display? &lt;BR /&gt;&lt;BR /&gt;  You either need to define the operator, or use an expression that results in a data type for which the "&amp;lt;&amp;lt;" operator is defined.&lt;BR /&gt;&lt;BR /&gt;  Why did it "work" before? Maybe a bug that's been fixed? Although I can compile your program under an older version of C++, I can't link it (missing some components?). So, I can't see what output you were getting.&lt;BR /&gt;</description>
      <pubDate>Sun, 26 Jun 2005 22:10:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909235#M32376</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-06-26T22:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909236#M32377</link>
      <description>John,&lt;BR /&gt;   The program prints:&lt;BR /&gt;Alaska's capital is Juneau.&lt;BR /&gt;Arkansas's capital is Little Rock.&lt;BR /&gt;California's capital is Sacramento.&lt;BR /&gt;Illinois's capital is Springfield.&lt;BR /&gt;Missouri's capital is Jefferson City.&lt;BR /&gt;Nevada's capital is Carson City.&lt;BR /&gt;West Virginia's capital is Charleston.&lt;BR /&gt;Wisconsin's capital is Madison.&lt;BR /&gt;&lt;BR /&gt;Looking for Wisconsin.&lt;BR /&gt;Found.&lt;BR /&gt;Wisconsin's capital is Madison.&lt;BR /&gt;&lt;BR /&gt;It runs OK under Windows and on one Alpha box, but not the one I have to work with. I'm trying to figure out why that is so.</description>
      <pubDate>Mon, 27 Jun 2005 14:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909236#M32377</guid>
      <dc:creator>Bob Williams_5</dc:creator>
      <dc:date>2005-06-27T14:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909237#M32378</link>
      <description>Bob,&lt;BR /&gt;&lt;BR /&gt;  Note that the error message says the operand type is "const state". &lt;BR /&gt;&lt;BR /&gt;  If you change the code defining the operator to:&lt;BR /&gt;&lt;BR /&gt;ostream &amp;amp; operator&amp;lt;&amp;lt;(ostream &amp;amp;s, const state &amp;amp;o)&lt;BR /&gt;&lt;BR /&gt;  the NOMATOPRFUN error goes away, but you then get a complaint about get_name and get_capital. Removing those references from the operator, I can get your program to compile and run, but obviously I don't see the names.&lt;BR /&gt;&lt;BR /&gt;  So, it looks like this is something to do with overly zealous type checking by the compiler, distinuishing between a constant and variable? &lt;BR /&gt;&lt;BR /&gt;  I can't see a reason why the compiler would think that *p refers to a constant. &lt;BR /&gt;&lt;BR /&gt;  If that doesn't help, please log a case with your local customer support centre.&lt;BR /&gt;&lt;BR /&gt;  (personally I subscribe to the school of thought that C++ was a huge joke played on the programmer community by Bjarne Stroustrup)</description>
      <pubDate>Mon, 27 Jun 2005 16:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909237#M32378</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-06-27T16:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909238#M32379</link>
      <description>John,&lt;BR /&gt;  HP support's answer agreed with yours on changing "ostream &amp;amp;operator&amp;lt;&amp;lt;(ostream &amp;amp;s, state &amp;amp;o)" to "ostream &amp;amp;operator&amp;lt;&amp;lt;(ostream &amp;amp;s, const state &amp;amp;o)". Also, I need to change "string get_name() { return name; }" to "string get_name() const { return name; }" and do the same for "string get_capital()". &lt;BR /&gt;  I've attached their response, where they explain the change in the latest version of C++ and discuss fixes and workarounds.</description>
      <pubDate>Sat, 02 Jul 2005 23:54:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909238#M32379</guid>
      <dc:creator>Bob Williams_5</dc:creator>
      <dc:date>2005-07-02T23:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: STL example compile errors</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909239#M32380</link>
      <description>See above.</description>
      <pubDate>Sat, 02 Jul 2005 23:59:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/stl-example-compile-errors/m-p/4909239#M32380</guid>
      <dc:creator>Bob Williams_5</dc:creator>
      <dc:date>2005-07-02T23:59:12Z</dc:date>
    </item>
  </channel>
</rss>

