Default template argument when using std::enable_if as templ. param.: why OK with two template functions that differ only in the enable_if parameter?

后端 未结 2 1340
耶瑟儿~
耶瑟儿~ 2020-11-30 11:04

In the language reference of std::enable_if at cppreference the following note is included

Notes

A common mistake is to d

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 11:45

    The common mistake is:

    template >
    void foo()
    
    template >
    void foo()
    

    which both declare

    template 
    void foo();
    

提交回复
热议问题