[C++] Template inheritence problem
From: Garrett Kajmowicz (gkajmowi_at_tbaytel.net)
Date: 07/25/04
- Next message: Anand Hariharan: "Re: Template parameter that has a template argument list"
- Previous message: Stephen Tyndall: "Re: [OT] Re: Graphics Question"
- Next in thread: David White: "Re: [C++] Template inheritence problem"
- Reply: David White: "Re: [C++] Template inheritence problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 24 Jul 2004 22:42:27 -0400
I'm working on (slowly) implementing the standard library, with a few
modifications.
I've defined basic string as follows:
#include <memory>
#include <vector>
#include <exception>
template<class Ch, class Tr = char_traits<Ch>, class A =
allocator<Ch> > class basic_string
: public vector<Ch, A>
{
//...
}
But my compiler is giving me an error:
filename error: base class `std::vector<char, std::allocator<char> >'
has incomplete type
../include/string: In constructor `std::basic_string<Ch, Tr,
A>::basic_string(const A&) [with Ch = char, Tr =
std::char_traits<char>, A = std::allocator<char>]':
instantiated from here ../include/string:69: error: type
`struct std::vector<char,
std::allocator<char> >' is not a direct base of
`std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
Is there something that I am missing, or have I found (yet another)
compiler bug? (GCC 3.3.4) I have no problems creating a std::vector<char,
std::allocator<char> > in an application.
Thanks for the help.
- Garrett Kajmowicz
- Next message: Anand Hariharan: "Re: Template parameter that has a template argument list"
- Previous message: Stephen Tyndall: "Re: [OT] Re: Graphics Question"
- Next in thread: David White: "Re: [C++] Template inheritence problem"
- Reply: David White: "Re: [C++] Template inheritence problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|