Thread View: comp.lang.c++.leda
2 messages
2 total messages
Started by Ashvin Kannan
Fri, 04 Aug 1995 19:33
GRAPH does not print user-defined type of parameter.
Author: Ashvin Kannan
Date: Fri, 04 Aug 1995 19:33
Date: Fri, 04 Aug 1995 19:33
40 lines
1186 bytes
1186 bytes
The parameterized graph (GRAPH) does not print the type of the parameter
for the method write(), if it is user-defined. I'm using LEDA 3.1.2 and g++
2.6.3. I know that it used to work for LEDA 3.0. Can someone please point
out the problem/workaround. Sample code and output follow.
Thanks!
Ashvin
----------------------------------------------------------------------
#include <LEDA/graph.h>
class foo {int a;};
int main()
{
GRAPH<int, string> G;
G.write(cout);
GRAPH<int, foo> fooG;
fooG.write(cout);
}
----------------------------------------------------------------------
OUTPUT:
%a.out
LEDA.GRAPH
int
string
0
0
LEDA.GRAPH
int
unknown
0
0
%
----------------------------------------------------------------------
=======
Re: GRAPH does not print user-defined type of parameter.
Author: Marion Sperle
Date: Mon, 14 Aug 1995 09:49
Date: Mon, 14 Aug 1995 09:49
30 lines
1312 bytes
1312 bytes
Ashvin wrotes:
>The parameterized graph (GRAPH) does not print the type of the parameter
>for the method write(), if it is user-defined. I'm using LEDA 3.1.2 and g++
>2.6.3. I know that it used to work for LEDA 3.0. Can someone please point
>out the problem/workaround. Sample code and output follow.
>----------------------------------------------------------------------
>#include <LEDA/graph.h>
>class foo {int a;};
>int main()
>{
> GRAPH<int, string> G;
> G.write(cout);
> GRAPH<int, foo> fooG;
> fooG.write(cout);
>
>}
Do you have defined the function Print(const foo&, ostream&) as friend in your
class foo, which is called by the LEDA-method GRAPH.write() to linearize
user-defined classes?
I hope I could help you
Marion
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads