copy.rst.svn-base

来自「本人找过多个在linux下c++的lua5.1封装库,但很少.luabind已经」· SVN-BASE 代码 · 共 54 行

SVN-BASE
54
字号
copy----------------Motivation~~~~~~~~~~This will make a copy of the parameter. This is the default behavior whenpassing parameters by-value. Note that this can only be used when passing fromC++ to Lua. This policy requires that the parameter type has an accessible copyconstructor.Defined in~~~~~~~~~~.. parsed-literal::    #include <luabind/copy_policy.hpp>Synopsis~~~~~~~~.. parsed-literal::    copy(index)Parameters~~~~~~~~~~============= ===============================================================Parameter     Purpose============= ===============================================================``index``     The index to copy. ``result`` when used while wrapping C++              functions. ``_N`` when passing arguments to Lua.============= ===============================================================Example~~~~~~~.. parsed-literal::    X* get()    {        static X instance;        return &instance;    }    ...    module(L)    [        def("create", &create, **copy(result)**)    ];

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?