非类型模板参数的有关问题

非类型模板参数的问题
const int size = 10;
const int* const ptr = &size
;template <const int *ptr> class BufPtr;
template <int size> 
class Buf{
public:Buf() {}
~Buf() {}
private: 
}
;template <const int *ptr> 
class BufPtr {
public: 
BufPtr() {} 
~BufPtr() {} 
}; 
int main() 
{
int size_val = 1024;
const int c_size_val = 1024; 
Buf<1024> A1; 
Buf<c_size_val> A2;
Buf<sizeof(size_val)> A3; 
BufPtr<ptr> B1; 
BufPtr< &size > B2; 

为什么报错?应该怎样写?用的VS2010编译器
------解决方案--------------------
1. 不能使用全局指针作为模板参数

2. size被常量折叠了
   强制在定义前面加extern,使他变为外部链接,强制分配内存就不会被折叠了