Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2008-08-01 15:34:11


Gubenko, Boris wrote:
> Boost.Test library test basic_cstring_test.cpp fails to compile
> on many (all?) platforms using GNU libstdc++. Follows reproducer
> and the results of compiling it with GNU 4.3.0 and 3.4.6.
>
> Replacing 'utf::basic_cstring<CharT>::size_type' with 'std::size_t'
> in libs/test/test/basic_cstring_test.cpp makes the problem go away.
>
> Is it a known problem in GNU libstdc++? Does the fact that the
> implementation does not have to provide specializations of
> basic_string<> other than for 'char' and 'wchar_t' makes x.cpp
> below illegal?
>
> Thanks,
> Boris
>
> x.cpp
> -----
> #include <string>
>
> template<typename T> void foo(T) {
> std::basic_string<T>::size_type i = 1;
> }
>

Aren't you missing a 'typename' in the above ?

template<typename T> void foo(T)
{
   typename std::basic_string<T>::size_type i = 1;
}

should work.

HTH,
       Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk