0

I am trying to make nvcc (g++/EDG) play nicely with latest boost

template<typename U>                                        \
   static false_type has_member(tester<&U::member_name>*); \

gives

/opt/boost/include/boost/thread/locks.hpp:65: error: ‘&’ cannot appear in a constant-expression
/opt/boost/include/boost/thread/locks.hpp:65: error: template argument 1 is invalid

any idea how to fix it?

CygnusX1
  • 20,968
  • 5
  • 65
  • 109
Anycorn
  • 50,217
  • 42
  • 167
  • 261

1 Answers1

1

What version of nvcc are you using?

I tried reproducing the error in the following simpler case, but it succeeded with compilation (CUDA 3.2):

#include <stdio.h>

class Test {
public:
    int x;
};

template <int Test::*S>
class Template {
};

template <typename T>
class Run {
    Template<&T::x> foo;
};

int main() {
    Run<Test> foo;
}
CygnusX1
  • 20,968
  • 5
  • 65
  • 109