🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jonas Nygren Tue, 04 Aug 1992 07:32
templates and friends
#254
Author: Jonas Nygren
Date: Tue, 04 Aug 1992 07:32
33 lines
1021 bytes
Below follows an example where gcc fails to generate a function from a template.
I believe this to be a bug but my understanding of templates is perhaps lacking.

/jonas

example ---




template<class T> int f(T &t) { return 0; }

int f(int &i) { return 0; }

template<class T> class A {
  int fi;
public:
  friend int f(A &a);
};

template<class T> int f(A<T> &a) { return a.fi; }

main(){
  A<int> a;
  f(a);
  f(1);
}

gcc 2.1 on an HP reports missing symbol (code):

  f__FRt1A1Zi

end example ---
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