🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Mark Stubley Tue, 11 Aug 1992 10:29
Non function templates
#112
Author: Mark Stubley
Date: Tue, 11 Aug 1992 10:29
79 lines
2339 bytes
The following code produces this error message from g++2.2 :-

Operations.cc:5 Sorry,not implemented: non-function templates not yet supported.

Could anyone tell me if the code is syntactically correct and if it is,
is there any fix or work around for the problem. I don't really
want to have to define instances of the Operations class.

-- Header File Operations.hh

// -*- C++ -*-

#ifndef _Operations_hh
#define _Operations_hh

#include "MyString.hh"
#include "PobjId.hh"
#include <builtin.h>

template <class T>
class Operations
{
public :
  static int EQ (T& key, T& tab);   
  static int LE (T& key, T& tab);
  static int CMP (T& key, T& tab);

  static unsigned int (*HASH) (T&);
};

template <class PobjId>
class Operations
{
public :
  static int EQ (PobjId& key, PobjId& tab);   
  static int LE (PobjId& key, PobjId& tab);
  static int CMP (PobjId& key, PobjId& tab);

 static unsigned int (*HASH)(PobjId&);
};

template <class String>
class Operations
{
public :
  static int EQ (String& key, String& tab);   
  static int LE (String& key, String& tab);
  static int CMP (String& key, String& tab);

  static unsigned int (*HASH) (const char *);
};

#endif

-- Source File Operations.cc

// -*- C++ -*-

#include "Operations.hh"

template <class T> unsigned int (Operations<T>::*HASH)(int&) = multiplicativehash; // line 5
template <class PobjId> unsigned int (Operations<T>::*HASH)(PobjId&) =  PobjId::hash;
template <class String> unsigned int (Operations<T>::*HASH)(PobjId&) = hashpjw;
.
.
.
. Source continues .....


Thanks in advance for any help you can provide

Mark

--
===========================================================================
Mark A. Stubley                                     (mas@fulcrum.bt.co.uk)
===========================================================================
Fulcrum communications L.T.D., Fordrough Lane, Birmingham, B9 5LD, ENGLAND.
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