Fixed placeholder compatibility with Boost 1.34.
[luabind.git] / doc / changes.txt
blob5d77c6d3a20a9b80cadd173f5fe40e0b20e9d7b7
1 LUABIND 7.1 changes
2 ===================
4 * Applied patches from Evan Wies to support lua 5.1
5 * added a new assignment operator and a special value,
6   luabind::nil, to set table entries to nil. 
9 LUABIND BETA 7 changes
10 ======================
12 We have introduced a change that may break current code,
13 nothing will break silently however.
15 The change is that the previous way of writing virtual class
16 wrappers was to have it contain an object that refered to
17 the actual lua object. This would cause a dependency cycle
18 and result in the object never being garbage collected until
19 the whole lua state was closed. The new way is to use a newly
20 introduced type called weak_ref, instead of the object.
21 See docs for more info.
24 Changes from beta6
25 ------------------
27 * renamed get_globals() and get_registry() to globals()
28   and registry()
29 * rewrote object and made a few changes:
31   * moved iterators out of the class and removed
32     begin/end/raw_begin/raw_end/array_begin/array_end.
33     See updated docs for how to use the iterators.
34   * removed array_iterator alltogether
35   * renamed pushvalue() to push()
36   * removed set()
37   * replaced the constructor that creates an object from
38     a stack value (with better syntax)
39   * moved out the member functions type(), at() and raw_at()
40     and made them free functions. (type(), gettable(), settable(),
41     rawget() and rawset())
42   * renamed lua_state() to interpreter()
43   * object now supports nested indexing (with []-operator) as
44     well as function calls directly on indexed values (i.e.
45     globals(L)["my_fun"](10)). The indexing has also been made
46     more efficient through the use of expression templates.
48 * removed functor (use object with call_function() instead)
50 * using boost-build, and has better support for building
51   as a dll. The makefiles still works.
52 * removed the option LUABIND_DONT_COPY_STRING, this means
53   that luabind will not provide storage for name strings.
54   i.e. the strings sent to module, namespace_ and class_
55   are expected to have global storage (it's no problem as
56   long as you use string constants)
59 wrappers
60 ........
62 Wrapper classes now have to derive from wrap_base and they don't have
63 to contain any references to the lua-part (this is done by the base
64 class now). The overload of call_member() that previuosly took a
65 weak_ref as first parameter is now a member function of the wrap_base
66 class and no longer takes the self reference argument. Example:
68 struct A
70     virtual ~A() {}
71     virtual std::string f() { return "A:f()"; }
74 struct A_wrap : A, wrap_base
76     virtual std::string f()
77     {
78         return call_member<std::string>("f");
79     }
81     static std::string default_f(A* p)
82     {
83         return p->A::f();
84     }
87 The changes when registering the virtual functions is that you now
88 have to register both the virtual function _and_ the default
89 implementation of the function (for static dispatch). Like this:
91 module(L)
93     class_<A, A_wrap>("A")
94         .def(constructor<>())
95         .def("f", &A::f, &A_wrap::default_f)
98 If you update your luabind version without changing the way you register
99 virtual functions, it will still compile, but may give you runtime
100 errors.
102 With these changes adopt will work as expected on wrapped types (the
103 weak reference will be transformed into a strong reference internally).
105 These changes will also make dynamic function dispatch work from within
106 lua (and not just from c++ into lua).
109 policy placeholders
110 ...................
112 luabind now handles member functions in a more general way.
113 The self reference that is passed as first parameter to
114 member functions is now refered to using the _1 placeholder
115 (instead of self). This means that the first argument to a
116 member function is refered to with _2.
119 additions
120 .........
122 * added __newindex metatable entry on c++ classes
123 * moved more code into cpp-files (hopefully reduces user
124   compile time slightly)
125 * the iterators are now true models of ForwardIterator
126 * error messages when writing non-matching type to a property
127   or attribute.
128 * support for inner scopes
129 * support for nil to holder_type conversion
130 * wrappers for lua_resume() with the same syntax as
131   call_function() (resume_function() and resume())
134 bugfixes
135 ........
137 * bugs in the overload resolution could give internal errors
138   in some cases.
139 * def_readonly and def_readwrite will now return references
140   if the type is not a primitive type. This will allow
141   chained . operators.
142 * object_cast() of uninitialized objects works
143 * supports strings with extra nulls in them (not for member
144   names though)
145 * fixed reference leakage by reducing the amount of explicit
146   resource management.
147 * fixed bug where matchers for getters and setters did not
148   propagate to derived classes.
149 * fixed leak when using class wrappers. They had a reference
150   cycle that wouldn't get collected (until the lua_State was
151   closed).
152 * lots of other fixes we can't remember