Joh*_*son 3 c++ initialization variable-assignment
当我做一些实验时,我遇到了这条线:
int home_address = current_pos_ = hash(key, size_);
Run Code Online (Sandbox Code Playgroud)
而我想知道它究竟是做什么的?(不是哈希函数或任何东西,只是"int variable = variable = value;"的东西)
该表达式如下:
int home_address = (current_pos_ = hash(key,size_));
Run Code Online (Sandbox Code Playgroud)
其分配的结果hash(key,size_)
为current_pos_
它然后分配的值current_pos_
成home_address
.