65,187
社区成员




#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1) \
extern "C++" \
{ \
template <size_t _Size> \
inline \
_ReturnType __CRTDECL _FuncName(_DstType (&_Dst)[_Size], _TType1 _TArg1) \
{ \
return _FuncName(_Dst, _Size, _TArg1); \
} \
}
#include <iostream>
using namespace std;
template<int size>
void fun(int a[size], int (&b)[size])
{
cout<<sizeof(a)<<endl;
cout<<sizeof(b)<<endl;
}
int main()
{
int a[3],b[3];
fun<3>(a,b);
return 0;
}
int main()
{
int x[3]={1,2,3};
int(&y)[3] = x;
printf("%d %d %d",y[0],y[1],y[2]);
return 0;
}