Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Compaq C++ templates: bug?
@ 2000-06-14  4:00 nkauer
  0 siblings, 0 replies; only message in thread
From: nkauer @ 2000-06-14  4:00 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-06-14  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-14  4:00 Compaq C++ templates: bug? nkauer

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