Is it legal C++ to pass the address of a static const int with no definition to a template?

后端 未结 4 453
刺人心
刺人心 2021-01-15 11:53

I\'m having trouble deciding whether not this code should compile or if just both compilers I tried have a bug (GCC 4.2 and Sun Studio 12). In general, if you have a static

4条回答
  •  温柔的废话
    2021-01-15 12:08

    You are trying to pass a runtime value to a template, that's not possible. The only allowed template parameters are types (class/typename) or integral constant values (int/bool/etc).

提交回复
热议问题