In a header, I have the following class template:
template<typename _ListItem>
class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem>
{
};
However, this won't compile:
$ g++ -c simplelist.cc -o simplelist.o
In file included from simplelist.h:11,
from simplelist.cc:1:
simplelist.h:127: error: `SimpleListItemConvert' is not a
template type
Why is it not a template type? Can a template class not inherit from
another template? At this point, I haven't even tried to instantiate
it.
Thanks,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail. 4 1608
"Roger Leigh" <${******@invalid.whinlatter.uklinux.net.invalid > wrote... In a header, I have the following class template:
template<typename _ListItem> class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem> { };
However, this won't compile:
$ g++ -c simplelist.cc -o simplelist.o In file included from simplelist.h:11, from simplelist.cc:1: simplelist.h:127: error: `SimpleListItemConvert' is not a template type
Why is it not a template type? Can a template class not inherit from another template? At this point, I haven't even tried to instantiate it.
(a) You're not inheriting from a template, you're inheriting from
an instantiation of a template. pqxxobject::RowConvert<_ListItem>
is a concrete class.
(b) Please read FAQ 5.8 and follow its recommendations. There is
not enough information in your post to advise anything beyond that
you probably have 'SimpleListItemConvert' forward-declared somewhere
as a class and not a template.
Victor
Roger Leigh wrote in news:87************@wrynose.whinlatter.uklinux.net : In a header, I have the following class template:
template<typename _ListItem> class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem> { };
It (Most probably) isn't your problem but identifiers like _Listitem,
i.e. that start with a _ followed by one of A-Z, are reserverd for
you implementation.
However, this won't compile:
$ g++ -c simplelist.cc -o simplelist.o In file included from simplelist.h:11, from simplelist.cc:1: simplelist.h:127: error: `SimpleListItemConvert' is not a template type
You need to tell us what pqxxobject and pqxxobject::RowConvert are.
preferably showing us declaration's. Why is it not a template type? Can a template class not inherit from another template? At this point, I haven't even tried to instantiate it.
Yes thay can, example:
struct X
{
template < typename T > struct XX
{
};
};
template < typename T > struct Y : X::XX< T >
{
};
int main()
{
Y< int > yi;
}
Rob.
-- http://www.victim-prime.dsl.pipex.com/
"Victor Bazarov" <v.********@comAcast.net> writes: "Roger Leigh" <${******@invalid.whinlatter.uklinux.net.invalid > wrote... In a header, I have the following class template:
template<typename _ListItem> class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem> { };
However, this won't compile:
$ g++ -c simplelist.cc -o simplelist.o In file included from simplelist.h:11, from simplelist.cc:1: simplelist.h:127: error: `SimpleListItemConvert' is not a template type
Why is it not a template type? Can a template class not inherit from another template? At this point, I haven't even tried to instantiate it. (a) You're not inheriting from a template, you're inheriting from an instantiation of a template. pqxxobject::RowConvert<_ListItem> is a concrete class.
ACK.
(b) Please read FAQ 5.8 and follow its recommendations. There is not enough information in your post to advise anything beyond that you probably have 'SimpleListItemConvert' forward-declared somewhere as a class and not a template.
That was 100% spot on. There was a friend class declaration in
another class--I didn't realise friend counted as forward declaration.
I'll include more detail next time.
Many thanks,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Roger Leigh wrote: In a header, I have the following class template:
template<typename _ListItem> class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem> { };
However, this won't compile:
works for me:
class pqxxobject
{
public:
template <typename z>
struct RowConvert
{
};
};
template<typename _ListItem>
class SimpleListItemConvert : public pqxxobject::RowConvert<_ListItem>
{
}; This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dave O'Hearn |
last post by:
This is a stripped down example that duplicates the problem I am
having. If I do it with concrete types, I can access the set's
iterator type correctly. If I make a template with generic types, I...
|
by: David M Noriega |
last post by:
Ok I'm no programmer but have done it in the past. I am trying to build
a program from its source, its called Juk. It needs the kde bindings for
GStreamer. I found them using CVS. So no I must...
|
by: Gil |
last post by:
Hope this is the right group to post to.
I compiled C++ code that ran fine on Windows with VisualStudio 6.0.
I then moved the code to Solaris 9 and compiled with g++, but am
getting the...
|
by: Nicolas GALAN |
last post by:
Hello,
I've a problem about templates which occurs on g++ and not with CC on Irix.
g++ says :
Test.cpp: In member function `void A::test()':
Test.cpp:53: error: parse error before `>' token
...
|
by: Lionel B |
last post by:
Greetings.
The following code compiles ok and does what I'd expect it to do:
---------- START CODE ----------
// test.cpp
|
by: case2005 |
last post by:
Can anyone help with the following, I don't know if it's possible, but I'm
certain there must be a standard way of dealing with this.
I have the following:
template<typename FooBar, typename...
|
by: henkoo |
last post by:
i want to explicit instantiate a member function of a class template,
and got some error,
can anyone give some advice to correct it?
3x
complier: g++ 3.2
#include <iostream>
#include...
|
by: gio |
last post by:
I have a template class with a function that looks like this:
template <class Key, int Value, class Tail>
struct Parser<Typelist< MakePair<Key, Value>, Tail >, EmptyType>
{
static...
|
by: lobequadrat |
last post by:
Hello,
I am trying to get the following code work (unfortunately not
mine ... :( )
template <class Tclass Test {
public:
class ELEM;
|
by: Adam Nielsen |
last post by:
Hi all,
I'm a bit confused about the syntax used to access a nested template
class. Essentially I have a bunch of class types to represent different
types of records in a database, and I want...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |