Using an int as a template parameter that is not known until run-time

后端 未结 5 1474
谎友^
谎友^ 2021-01-02 19:04

I am trying to use an integer as a template parameter for a class. Here is a sample of the code:

template< int array_qty > 
class sample_class {

    p         


        
5条回答
  •  一整个雨季
    2021-01-02 19:13

    Sorry, this is not possible. The template argument must be a constant expression known at compile time.

提交回复
热议问题