rvalue和xvalue有什么区别?

时间:2016-04-25 23:27:48

标签: c++ c++11 c++14

我想更好地理解std::move()。我曾经认为它会为rvalue引用创建一个强制转换。但是在文档中我遇到了这个:

  

std::move生成一个xvalue表达式,用于标识其参数。它完全等同于static_castrvalue引用类型。

我不清楚为什么xvaluervalue一起存在C++11?这是C++14app = Flask(__name__) app.config['SECRET_KEY'] = "my precious" extra = ['Product_Type','Geography','Third'] @app.route("/category", methods=["GET", "POST"]) def index(): """ Render form and handle form submission """ form = TestForm(request.form) form.category_1.choices = [('', 'Select a Category')] + [(x) for x in enumerate(extra,1)] chosen_category_1 = None chosen_category_2 = None chosen_category_3 = None return render_template('index.html', form=form) @app.route("/category/<int:category_1_id>/", methods=["POST"]) def get_request(category_1_id): data = [(x) for x in enumerate(extra,1) if x[0] != category_1_id] response = make_response(json.dumps(data)) response.content_type = 'application/json' return response if __name__ == "__main__": app.run(debug=True) 标准的关系吗?

0 个答案:

没有答案