Force type of C++ template

前端 未结 6 1270
难免孤独
难免孤独 2020-12-28 21:34

I\'ve a basic template class, but I\'d like to restrain the type of the specialisation to a set of classes or types. e.g.:

template 
class          


        
6条回答
  •  情深已故
    2020-12-28 21:54

    Take a look at the Boost Concept Check Library: http://www.boost.org/doc/libs/1_42_0/libs/concept_check/concept_check.htm

提交回复
热议问题