NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2892

'statement' : reference template parameters are not supported

You cannot use a reference argument in a template parameter. For example, the following sample generates C2892. The comment line in the following example (below the line that gives the error) has code that shows one way to resolve the error.

#include <stdio.h>

void func(int* const n) {
   printf("\ntest\n");
}

template <int*& I = 0>      // error C2892
// template <int* I = 0>
struct  Y
{
   void mf() { func(I); }
};

void mf()
{
  Y<> a;
  a.mf();
}

void main(){mf();}