Using 'void' template arguments in C++

前端 未结 5 1085
执念已碎
执念已碎 2020-12-09 09:54

Take the following minimal example:

using Type1 = std::function;

template 
using Type2 = std::function;

         


        
5条回答
  •  盖世英雄少女心
    2020-12-09 10:22

    Void can be interpreted as an empty parameter if you pass it to a function. You're not using a void pointer after all so

    void func (void)
    

    becomes

    void func ()
    

提交回复
热议问题