Why is this “min” template of cpp-next at fault?

前端 未结 5 722
时光取名叫无心
时光取名叫无心 2021-01-03 21:39

I was reading cpp-next where this min template is presented as an example of how verbose C++ code can be compared to python code

template 

        
5条回答
  •  [愿得一人]
    2021-01-03 22:03

    The arguments are passed by value (T and U deduced as int), but the type of ?: expression is deduced as a reference in this case since they are local lvalues inside the function. Specifics will be in @Johannes' answer that should come in a few minutes. :D

提交回复
热议问题