Compile time type checking C++

后端 未结 3 876
春和景丽
春和景丽 2021-01-14 00:22

I have created a type list. I then create a class using a template passing the type list. When I call the print function of the class with a some types not specified they ar

3条回答
  •  醉梦人生
    2021-01-14 01:09

    You could take your arguments by non-const reference, forcing them to be the exact same type. However you can no longer use it with const variables or literals.

提交回复
热议问题