来自https://isocpp.org/wiki/faq/cpp14-language
from tkinter import *
root = Tk()
canvas = Canvas(root)
def create_button(location_name, position_x, position_y):
Button(root, text = location_name).place(x=position_x, y=position_y, width=60, height=20)
a = create_button("A",20,30)
b = create_button("B",70,80)
canvas.grid()
root.mainloop()
第一个返回
string lookup1(); decltype(auto) look_up_a_string_1() { auto str = lookup1(); return str; } decltype(auto) look_up_a_string_2() { auto str = lookup1(); return(str); }
,第二个返回string
,这是一个 引用局部变量string &
。
为什么str
会返回look_up_a_string_2
?