Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
wrapping c++
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-12-21 (19:59)
From: ygrek <ygrekheretix@g...>
Subject: Re: [Caml-list] wrapping c++
On Mon, 20 Dec 2010 22:16:44 +0000
Joel Reymont <> wrote:

> Are there any recipes for wrapping a large C++ class that uses callbacks?

All the same as C bindings. But using C++ features one can reduce the
amount of boilerplate needed. E.g. see
for a simple template class to wrap C++ objects as ocaml custom values (bindings to non-trivial
C++ lib will probably need wrapping smart_ptr's as well). Also simple tricks
like RAII for blocking_section save some typing. But all in all it is the same
manual translation.