lua_pushvalue

[-0, +1, -]

void lua_pushvalue (lua_State *L, int index);

Pushes a copy of the element at the given valid index onto the stack

 

如上所述, lua_pushvalue(L, -4) 并不是往栈顶插入元素-4, 而是把在栈中位置为-4的元素copy之后插入于栈顶中!!!

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2021-10-26
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-06-24
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案