我想更好地理解std::move()
。我曾经认为它会为rvalue
引用创建一个强制转换。但是在文档中我遇到了这个:
std::move
生成一个xvalue
表达式,用于标识其参数。它完全等同于static_cast
到rvalue
引用类型。
我不清楚为什么xvalue
与rvalue
一起存在C++11
?这是C++14
与app = 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)
标准的关系吗?