Passing a pointer to a member function as a template argument. Why does this work?

前端 未结 2 1609
有刺的猬
有刺的猬 2021-02-12 11:40

I have some code that 100% works for the use case I have. I\'m just wondering if anyone can explain how and why it works.

I have a template class that sits between so

2条回答
  •  逝去的感伤
    2021-02-12 12:04

    When you ask a question along the lines of "why something works?", it implies that the fact that it works is somehow surprising to you. It is impossible to answer the question unless you explain why you find it surprising.

    Why it works? Because the language specification explicitly says that it shall work. There's no other answer, until you explain your concerns in more detail.

提交回复
热议问题