Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: nkauer@my-deja.com
Subject: Compaq C++ templates: bug?
Date: 2000/06/14	[thread overview]
Message-ID: <8i8irq$96h$1@nnrp1.deja.com> (raw)

With the code below and using Compaq C++ V6.2-024 for Digital UNIX V4.0F
I get this error message multiple times:
"cannot overload functions based on pointer size of the parameters
alone"

Basically everytime I "mention" a specialization of a
template that has the values of an enumeration as only
parameter, I get this error.  Is this a current limitation
of Compaq's C++ compiler template implementation or is there
something wrong with my code?  Any clues are greatly appreciated.

Nikolas

----------------------------------------------------------------
in header files:

enum Subprocess { gg, gu, gd, gub, gdb, uub, ddb };

template<Subprocess subproc> void off_shell_top_jet_func(const double
x[], const int k[], const double& wgt, const double aux[], double f[]);

typedef void (*Integrand)(const double x[], const int k[], const double&
wgt, const double aux[], double f[]);

class Xcalc
{
public:
  Xcalc(int cdim, int cnbin, int ddim, int adim, int nvals[], int fn_,
Integrand fxn, int ncpu_ = 1);
  void set_integrand(Integrand fxn);
  [...]
};
------------------------------------------------------------------------
in main.cpp:

int main()
{
  [...]
  Xcalc xcalc(cdim, cnbin, ddim, adim, nvals_gg, fn_,
&off_shell_top_jet_func<gg>);
  => this is OK
  [...]
  xcalc.set_integrand(&off_shell_top_jet_func<gu>);
  => error message
  [...]
}

------------------------------------------------------------------------
in different translation unit:

// explicitly instantiate specializations used in main.cpp
template void off_shell_top_jet_func<gg>(const double x[], const int
k[], const double& wgt, const double aux[], double f[]);
=> error message
template void off_shell_top_jet_func<gu>(const double x[], const int
k[], const double& wgt, const double aux[], double f[]);
=> error message
[...]

template<Subprocess subproc> void off_shell_top_jet_func(const double
x[], const int k[], const double& wgt, const double aux[], double f[])
{
  [...]
}


Sent via Deja.com http://www.deja.com/
Before you buy.



                 reply	other threads:[~2000-06-14  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox