luabind


how to bind a functor with more than one argument to lua using luabind


If I want to bind a functor with one argument to lua using luabind, the following code could help:
struct vec
{
int operator()(int a)
{
return a + 10;
}
};
module(L)
[
class_<vec>("vec")
.def( self(int()) )
];
But how to bind a functor with more than one argument, for example:
struct vec
{
int operator()(int a, int b, int c)
{
return a + b + c;
}
}
You should use the tag_function.
http://www.rasterbar.com/products/luabind/docs.html#binding-function-objects-with-explicit-signatures

Related Links

Luabind pure_out_value refuses to compile
Bind function returning btVector3 with luabind
how to bind a functor with more than one argument to lua using luabind
lua-function as parameter for exported function

Categories

HOME
windows
algorithm
api
awk
serialization
apiblueprint
socket.io
shiro
nuget
google-cloud-functions
spring-data-mongodb
entity-framework-core
cakephp-3.4
zip
jquery-ui
missing-data
enthought
github-enterprise
siddhi
windows-ce
jxl
android-intent
imessage
sigma.js
breadth-first-search
cgbitmapcontext
qliksense
mount
siri
opentk
constexpr
custom-controls
wacom
clickjacking
getlasterror
docfx
xdocreport
odroid
apns-php
c9.io
wmp
dbnull
plr
xmldocument
wc
procfile
httrack
dotnet-httpclient
trojan
arq
stdmap
context-sensitive-grammar
seq
flac
javafx-css
meteor-packages
watch-os-2
xdoclet
refinerycms
nss
findfirst
cycle2
tfs-workitem
gocql
r-package
oracle-spatial
microsoft-reporting
page.js
batik
amiga
skspritenode
ms-access-2000
nsurlsessiondatatask
diff3
cosine-similarity
qscrollarea
dtmf
asplinkbutton
qtconcurrent
uimanageddocument
fitbounds
convention
jquery-tools
listactivity
mbeans
undefined-index
maven-1
isapi-extension
zen
sifr
scrubyt
wysiwym
fault-tolerance
java1.4

Resources

Encrypt Message