I am wondering why void()
is a prvalue of void
but void{}
does not exist...? See the following answer: https://stackoverflow.com/a/37708167/293195
For example in the context:
template<typename R>
R foo(){
return R{};
}
CWG 2351, resolved in June, has made void{}
legal.
来源:https://stackoverflow.com/questions/53263974/why-doesnt-void-exist