Why is my log in the std namespace?

前端 未结 5 2209
闹比i
闹比i 2020-11-27 15:05

In the code below, I define a trivial log function. In main I try not to call it; I call std::log. Nevertheless, my own

5条回答
  •  佛祖请我去吃肉
    2020-11-27 15:52

    What happens, I expect, is that std::log simply delegates to ::log. Unfortunately, ::log only provides a float overload, and you kindly provide a double overload, making yours a better match. But I still don't see how it even gets considered in the overload set.

提交回复
热议问题