title: Error while using CUDA and C++11
body: <p>I am using CUDA 4.1 and GCC 4.5 ... (FINALLY! CUDA supports GCC 4.5, but still waiting for GCC 4.6). Anyways, is it possible to use C++11 with the CUDA 4.1?</p>
  
  <p>I tried passing:</p>
  
  <pre><code>--compiler-options "-std=c++0x"
  </code></pre>
  
  <p>to nvcc and it throws a bunch of errors at me:</p>
  
  <pre><code>/usr/include/c++/4.5/exception_ptr.h(100): error: copy constructor for class "std::__exception_ptr::exception_ptr" may not have a parameter of type "std::__exception_ptr::exception_ptr"
  
  /usr/include/c++/4.5/exception_ptr.h(100): error: expected a ")"
  
  /usr/include/c++/4.5/exception_ptr.h(110): error: expected a ")"
  
  /usr/include/c++/4.5/exception_ptr.h(132): error: identifier "type_info" is undefined
  
  /usr/include/c++/4.5/exception_ptr.h(101): error: identifier "__o" is undefined
  
  /usr/include/c++/4.5/exception_ptr.h(112): error: expected a "&gt;"
  
  /usr/include/c++/4.5/exception_ptr.h(112): error: identifier "__o" is undefined
  
  /usr/include/c++/4.5/nested_exception.h(62): error: expected a ";"
  
  /usr/include/c++/4.5/nested_exception.h(64): error: expected a ";"
  
  /usr/include/c++/4.5/nested_exception.h(77): error: member function "std::nested_exception::~nested_exception" may not be redeclared outside its class
  
  /usr/include/c++/4.5/nested_exception.h(77): error: function "std::&lt;error&gt;" may not be initialized
  
  /usr/include/c++/4.5/nested_exception.h(77): error: expected an expression
  
  /usr/include/c++/4.5/nested_exception.h(82): error: expected a ")"
  
  /usr/include/c++/4.5/nested_exception.h(110): error: expected a ")"
  
  /usr/include/c++/4.5/nested_exception.h(115): error: expected a ")"
  
  /usr/include/c++/4.5/nested_exception.h(122): error: expected a ")"
  
  /usr/include/c++/4.5/nested_exception.h(127): error: expected a ")"
  
  /usr/include/c++/4.5/nested_exception.h(127): error: function template "std::__throw_with_nested" has already been defined
  
  /usr/include/c++/4.5/bits/cpp_type_traits.h(180): error: identifier "char16_t" is undefined
  
  /usr/include/c++/4.5/bits/cpp_type_traits.h(187): error: identifier "char32_t" is undefined
  
  /usr/include/c++/4.5/bits/cpp_type_traits.h(187): error: class "std::__is_integer&lt;&lt;error-type&gt;&gt;" has already been defined
  
  21 errors detected in the compilation of "/tmp/tmpxft_00000ef2_00000000-4_test_cuda.cpp1.ii".
  </code></pre>
  
  <p>Example test.cu</p>
  
  <pre><code>#include &lt;cuda.h&gt;
  
  __host__ void test() {
    // nothing in method
  }
  </code></pre>
  
  <p>Compiles fine with:</p>
  
  <pre><code>nvcc -c -o test.o test.cu
  </code></pre>
  
  <p>But not with C++0x</p>
  
  <pre><code>nvcc -c -o test.o test.cu --compiler-options "-std=c++0x"
  </code></pre>