Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-05-27 10:20:32

On May 27, 2004, at 10:05 AM, Vladimir Prus wrote:

>> I've sent a reduced test case to the Metrowerks front end engineer.
> Thanks.
>> In
>> the meantime I can think of two workarounds:
>> 1. Specialize the entire basic_config_file_iterator class on wchar_t.
>> or
> This might be a good idea, especially since two other compilers --
> borland and
> VC7 have problems with the same member function specialization.
>> 2. Provide an inlined definition for the specialized member in the
>> header.
> Do you think that would help?

Here's my reduced test case:

#include <string>

struct base
        virtual bool getline(std::string& s) = 0;

template <class charT>
struct derived
        : public base
        bool getline(std::string& s);

template <>
derived<wchar_t>::getline(std::string&);// {return false;}

template <class charT>
        char test[sizeof(charT) == 1];
        return true;

int main()
        std::string s;
        derived<char> c;
        derived<wchar_t> w;

Error : data type is incomplete
  (instantiating: 'derived<wchar_t>::getline(std::basic_string<char,
std::char_traits<char>, std::allocator<char>> &)')
HelloWorld.cp line 24 char test[sizeof(charT) == 1];

If I give the specialization a definition, it compiles and runs
correctly at least on Pro 9. Sorry I don't have Pro 8 loaded to test

Btw our FE engineer has gotten back to me, confirmed this is a bug, and
it has already been fixed in our latest compiler (post-Pro 9, not yet


Boost list run by bdawes at, gregod at, cpdaniel at, john at