Re: R: R: R: R: R: Squid 3 build errors on Visual Studio - problem still present

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Tue, 15 Sep 2009 00:26:46 +0200

mån 2009-09-14 klockan 11:27 +0200 skrev Guido Serassio:

> Done. Sorry for the delay, but I'm very busy (as usual ...)
>
> I have placed the preprocessed source of two failing files
> (IpIntercept.cc and QosConfig.cc) here:
>
> http://www.acmeconsulting.it/libip.zip

Odd... std::string::npos is declared as follows:

namespace std;

template<class _Elem,
        class _Traits,
        class _Ax>
        class basic_string
                : public _String_val<_Elem, _Ax>
        {
public:
         static const size_type npos;
};

template<class _Elem,
        class _Traits,
        class _Alloc>
         const typename basic_string<_Elem, _Traits, _Alloc>::size_type
                basic_string<_Elem, _Traits, _Alloc>::npos =
                        (typename basic_string<_Elem, _Traits, _Alloc>::size_type)(-1);

typedef basic_string<char, char_traits<char>, allocator<char> >
        string;

Maybe Visual Studio drops the const attribute when trying to convert the
value from "const std::string:size_type" to "const String::size_type"
and gets lost somehow, even with the value as such being a simple size_t
integer..

What does it say about the attached code? My attempt in isolating the
String npos = std::string::npos code with as little change as possible
(had to kill the char_traits thing as that used template syntax not
accepted by G++ which slightly changes how size_type is declared)

Regards
Henrik

Received on Mon Sep 14 2009 - 22:26:51 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 17 2009 - 12:00:04 MDT