A
arno
Hi all,
if I compile the small example below without defining
"VC6_STUPID_BEHAVIOUR" I get the following compiler error:
error C2614: 'MyCString' : illegal member initialization: 'string' is
not a base or member
can somebody say me why??? In my opinion it should work in both
variants. On Solaris and HP-UX it works fine.
I have to work with MS VC++ 6.0 SP6
best regards
Arno
// vvvvvvvvvvvvvvv snipp vvvvvvvvvvvvvvvv
#include <string>
#include <iostream>
#ifdef VC6_STUPID_BEHAVIOUR
using std::string;
# define std_string string
#else
# define std_string std::string
#endif
class MyCString
: public std_string
{
public:
MyCString(const char *s_);
: std_string(s_)
{
std::cout << "\"" << *this << "\"" <<
std::endl;
};
};
int main (int argc, char *argv[])
{
MyCString s(argv[0]);
return 0;
}
// ^^^^^^^^^^^^ snipp ^^^^^^^^^^^^
if I compile the small example below without defining
"VC6_STUPID_BEHAVIOUR" I get the following compiler error:
error C2614: 'MyCString' : illegal member initialization: 'string' is
not a base or member
can somebody say me why??? In my opinion it should work in both
variants. On Solaris and HP-UX it works fine.
I have to work with MS VC++ 6.0 SP6
best regards
Arno
// vvvvvvvvvvvvvvv snipp vvvvvvvvvvvvvvvv
#include <string>
#include <iostream>
#ifdef VC6_STUPID_BEHAVIOUR
using std::string;
# define std_string string
#else
# define std_string std::string
#endif
class MyCString
: public std_string
{
public:
MyCString(const char *s_);
: std_string(s_)
{
std::cout << "\"" << *this << "\"" <<
std::endl;
};
};
int main (int argc, char *argv[])
{
MyCString s(argv[0]);
return 0;
}
// ^^^^^^^^^^^^ snipp ^^^^^^^^^^^^