Loading ...
Sorry, an error occurred while loading the content.

Patch for ISO-14882 compliance

Expand Messages
  • Guus Sliepen
    Hello everyone,There is a new C++ standard, ISO-14882, which amongst other things says that you must explicitly indicate that the functions from libstdc++
    Message 1 of 4 , Jul 14, 2001
    View Source
    • 0 Attachment
      Hello everyone,

      There is a new C++ standard, ISO-14882, which amongst other things says that
      you must explicitly indicate that the functions from libstdc++ are in the
      namespace "std". For crawl, this means that every occurence of "string" should
      be replaced by "std::string". The attached patch will do so.

      The changes should not mean anything if you are using older C++ compilers, but
      will allow correct compilation if you are using GCC 3.0 for example.

      --
      Met vriendelijke groet / with kind regards,
      Guus Sliepen <guus@...>
    • Jesse Jones
      ... Or you can just add a using namespace std to a common header file. This is usually a questionable idea, but I think it d be OK for Crawl. -- Jesse
      Message 2 of 4 , Jul 14, 2001
      View Source
      • 0 Attachment
        At 6:36 PM +0200 7/14/01, Guus Sliepen wrote:
        >Hello everyone,
        >
        >There is a new C++ standard, ISO-14882, which amongst other things says that
        >you must explicitly indicate that the functions from libstdc++ are in the
        >namespace "std". For crawl, this means that every occurence of "string" should
        >be replaced by "std::string". The attached patch will do so.
        >
        >The changes should not mean anything if you are using older C++ compilers, but
        >will allow correct compilation if you are using GCC 3.0 for example.

        Or you can just add a "using namespace std" to a common header file.
        This is usually a questionable idea, but I think it'd be OK for Crawl.

        -- Jesse
      • Guus Sliepen
        ... I followed the advise from: http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/porting-howto.html It says you can t use using namespace std in header
        Message 3 of 4 , Jul 15, 2001
        View Source
        • 0 Attachment
          On Sat, Jul 14, 2001 at 11:59:28AM -0700, Jesse Jones wrote:

          > >There is a new C++ standard, ISO-14882, which amongst other things says that
          > >you must explicitly indicate that the functions from libstdc++ are in the
          > >namespace "std". For crawl, this means that every occurence of "string" should
          > >be replaced by "std::string". The attached patch will do so.
          >
          > Or you can just add a "using namespace std" to a common header file.
          > This is usually a questionable idea, but I think it'd be OK for Crawl.

          I followed the advise from:

          http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/porting-howto.html

          It says you can't use "using namespace std" in header files, but then again,
          I'm not a C++ expert.

          --
          Met vriendelijke groet / with kind regards,
          Guus Sliepen <guus@...>
        • Jesse Jones
          ... And it s good advice, especially if you have a large app or are pulling in a lot of third party libraries. Neither of these are true for Crawl so I don t
          Message 4 of 4 , Jul 15, 2001
          View Source
          • 0 Attachment
            At 1:50 PM +0200 7/15/01, Guus Sliepen wrote:
            >On Sat, Jul 14, 2001 at 11:59:28AM -0700, Jesse Jones wrote:
            >
            >> >There is a new C++ standard, ISO-14882, which amongst other
            >>things says that
            >> >you must explicitly indicate that the functions from libstdc++ are in the
            >> >namespace "std". For crawl, this means that every occurence of
            >>"string" should
            >> >be replaced by "std::string". The attached patch will do so.
            >>
            >> Or you can just add a "using namespace std" to a common header file.
            >> This is usually a questionable idea, but I think it'd be OK for Crawl.
            >
            >I followed the advise from:
            >
            >http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/porting-howto.html
            >
            >It says you can't use "using namespace std" in header files, but then again,
            >I'm not a C++ expert.

            And it's good advice, especially if you have a large app or are
            pulling in a lot of third party libraries. Neither of these are true
            for Crawl so I don't think it's an issue. Also you'll often get the
            using declaration if you use include the .h headers (ie the C
            <string.h> instead of the C++ <string>).

            -- Jesse
          Your message has been successfully submitted and would be delivered to recipients shortly.