Type trait to check that all types in a parameter pack are copy constructible

后端 未结 4 498
生来不讨喜
生来不讨喜 2020-12-08 04:36

I need a type trait to check whether all types in a parameter pack are copy constructible. This is what I\'ve done so far. The main function contains some test cases, to che

4条回答
  •  情歌与酒
    2020-12-08 05:27

    I know that it is an old question but as we will have C++17 soon, I encourage to take a look at std::conjunction. With it you could write something like this

    template 
    using areCopyConstructible = typename std::conjunction...>::type;
    

提交回复
热议问题