My Project
class.hpp
1 // Copyright (c) 2003 Daniel Wallin and Arvid Norberg
2 
3 // Permission is hereby granted, free of charge, to any person obtaining a
4 // copy of this software and associated documentation files (the "Software"),
5 // to deal in the Software without restriction, including without limitation
6 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 // and/or sell copies of the Software, and to permit persons to whom the
8 // Software is furnished to do so, subject to the following conditions:
9 
10 // The above copyright notice and this permission notice shall be included
11 // in all copies or substantial portions of the Software.
12 
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
14 // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
18 // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
21 // OR OTHER DEALINGS IN THE SOFTWARE.
22 
23 
24 #ifndef LUABIND_CLASS_HPP_INCLUDED
25 #define LUABIND_CLASS_HPP_INCLUDED
26 
27 /*
28  ISSUES:
29  ------------------------------------------------------
30 
31  * solved for member functions, not application operator *
32  if we have a base class that defines a function a derived class must be able to
33  override that function (not just overload). Right now we just add the other overload
34  to the overloads list and will probably get an ambiguity. If we want to support this
35  each method_rep must include a vector of type_info pointers for each parameter.
36  Operators do not have this problem, since operators always have to have
37  it's own type as one of the arguments, no ambiguity can occur. Application
38  operator, on the other hand, would have this problem.
39  Properties cannot be overloaded, so they should always be overridden.
40  If this is to work for application operator, we really need to specify if an application
41  operator is const or not.
42 
43  If one class registers two functions with the same name and the same
44  signature, there's currently no error. The last registered function will
45  be the one that's used.
46  How do we know which class registered the function? If the function was
47  defined by the base class, it is a legal operation, to override it.
48  we cannot look at the pointer offset, since it always will be zero for one of the bases.
49 
50 
51 
52  TODO:
53  ------------------------------------------------------
54 
55  finish smart pointer support
56  * the adopt policy should not be able to adopt pointers to held_types. This
57  must be prohibited.
58  * name_of_type must recognize holder_types and not return "custom"
59 
60  document custom policies, custom converters
61 
62  store the instance object for policies.
63 
64  support the __concat metamethod. This is a bit tricky, since it cannot be
65  treated as a normal operator. It is a binary operator but we want to use the
66  __tostring implementation for both arguments.
67 
68 */
69 
70 #include <luabind/prefix.hpp>
71 #include <luabind/config.hpp>
72 
73 #include <string>
74 #include <cassert>
75 
76 #ifndef LUABIND_CPP0x
77 #include <boost/preprocessor/repetition/enum_params.hpp>
78 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
79 #include <boost/preprocessor/repetition/repeat.hpp>
80 #endif
81 #include <boost/type_traits/is_same.hpp>
82 #include <boost/type_traits/is_member_object_pointer.hpp>
83 #include <boost/mpl/apply.hpp>
84 #include <boost/mpl/lambda.hpp>
85 #include <boost/mpl/logical.hpp>
86 #include <boost/mpl/find_if.hpp>
87 #include <boost/mpl/eval_if.hpp>
88 #include <boost/mpl/logical.hpp>
89 #include <boost/mpl/vector/vector10.hpp>
90 
91 #include <luabind/config.hpp>
92 #include <luabind/scope.hpp>
93 #include <luabind/back_reference.hpp>
94 #include <luabind/function.hpp>
95 #include <luabind/dependency_policy.hpp>
96 #include <luabind/detail/constructor.hpp>
97 #include <luabind/detail/call.hpp>
98 #include <luabind/detail/deduce_signature.hpp>
99 #include <luabind/detail/primitives.hpp>
100 #include <luabind/detail/property.hpp>
101 #include <luabind/detail/typetraits.hpp>
102 #include <luabind/detail/class_rep.hpp>
103 #include <luabind/detail/call.hpp>
104 #include <luabind/detail/object_rep.hpp>
105 #include <luabind/detail/call_member.hpp>
106 #include <luabind/detail/enum_maker.hpp>
107 #include <luabind/detail/operator_id.hpp>
108 #include <luabind/detail/pointee_typeid.hpp>
109 #include <luabind/detail/link_compatibility.hpp>
110 #include <luabind/detail/inheritance.hpp>
111 #include <luabind/detail/signature_match.hpp>
112 #include <luabind/no_dependency.hpp>
113 #include <luabind/typeid.hpp>
114 
115 // to remove the 'this' used in initialization list-warning
116 #ifdef _MSC_VER
117 #pragma warning(push)
118 #pragma warning(disable: 4355)
119 #endif
120 
121 namespace boost
122 {
123 
124  template <class T> class shared_ptr;
125 
126 } // namespace boost
127 
128 namespace luabind
129 {
130  namespace detail
131  {
132  struct unspecified {};
133 
134  template<class Derived> struct operator_;
135 
137  }
138 
139  template<class T, class X1 = detail::unspecified, class X2 = detail::unspecified, class X3 = detail::unspecified>
140  struct class_;
141 
142  // TODO: this function will only be invoked if the user hasn't defined a correct overload
143  // maybe we should have a static assert in here?
145  get_const_holder(...)
146  {
147  return 0;
148  }
149 
150  template <class T>
152  {
153  return 0;
154  }
155 
156 # ifdef LUABIND_CPP0x
157 
158  template <class... Args>
159  struct bases
160  {};
161 
162  typedef bases<> no_bases;
163 
164 # else
165 
166  template <
167  BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
168  LUABIND_MAX_BASES, class A, detail::null_type)
169  >
170  struct bases
171  {};
172 
173  typedef bases<detail::null_type> no_bases;
174 
175 # endif // LUABIND_CPP0x
176 
177  namespace detail
178  {
179  template <class T>
180  struct is_bases
181  : mpl::false_
182  {};
183 
184 # ifdef LUABIND_CPP0x
185  template <class... Args>
186  struct is_bases<bases<Args...> >
187  : mpl::true_
188  {};
189 # else
190  template <BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, class A)>
191  struct is_bases<bases<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, A)> >
192  : mpl::true_
193  {};
194 # endif
195 
196  template <class T, class P>
198  : mpl::apply1<P, T>
199  {};
200 
201  template <class P>
203  : mpl::true_
204  {};
205 
206  template <class P>
208  {
209  template <class T>
210  struct apply
211  : is_unspecified<T, P>
212  {};
213  };
214 
215  template<class Predicate>
217  {
218  typedef mpl::protect<is_unspecified_mfn<Predicate> > type;
219  };
220 
221  template <class Result, class Default>
223  {
224  typedef Result type;
225  };
226 
227  template <class Default>
229  {
230  typedef Default type;
231  };
232 
233  template<class Parameters, class Predicate, class DefaultValue>
235  {
236  typedef typename get_predicate<Predicate>::type pred;
237  typedef typename boost::mpl::find_if<Parameters, pred>::type iterator;
238  typedef typename result_or_default<
239  typename iterator::type, DefaultValue
240  >::type type;
241  };
242 
243  // prints the types of the values on the stack, in the
244  // range [start_index, lua_gettop()]
245 
246  LUABIND_API std::string stack_content_by_name(lua_State* L, int start_index);
247 
248  struct LUABIND_API create_class
249  {
250  static int stage1(lua_State* L);
251  static int stage2(lua_State* L);
252  };
253 
254  } // detail
255 
256  namespace detail {
257 
258  template<class T>
260  {
261  static_scope(T& self_) : self(self_)
262  {
263  }
264 
265  T& operator[](scope s) const
266  {
267  self.add_inner_scope(s);
268  return self;
269  }
270 
271  private:
272  template<class U> void operator,(U const&) const;
273  void operator=(static_scope const&);
274 
275  T& self;
276  };
277 
278  struct class_registration;
279 
280  struct LUABIND_API class_base : scope
281  {
282  public:
283  class_base(char const* name);
284 
285  struct base_desc
286  {
287  type_id type;
288  int ptr_offset;
289  };
290 
291  void init(
292  type_id const& type, class_id id
293  , type_id const& wrapped_type, class_id wrapper_id);
294 
295  void add_base(type_id const& base, cast_function cast);
296 
297  void add_member(registration* member);
298  void add_default_member(registration* member);
299 
300  const char* name() const;
301 
302  void add_static_constant(const char* name, int val);
303  void add_inner_scope(scope& s);
304 
305  void add_cast(class_id src, class_id target, cast_function cast);
306 
307  private:
308  class_registration* m_registration;
309  };
310 
311 // MSVC complains about member being sensitive to alignment (C4121)
312 // when F is a pointer to member of a class with virtual bases.
313 # ifdef BOOST_MSVC
314 # pragma pack(push)
315 # pragma pack(16)
316 # endif
317 
318  template <class Class, class F, class Policies>
320  {
321  memfun_registration(char const* name, F f, Policies const& policies)
322  : name(name)
323  , f(f)
324  , policies(policies)
325  {}
326 
327  void register_(lua_State* L) const
328  {
329  object fn = make_function(
330  L, f, deduce_signature(f, (Class*)0), policies);
331 
332  add_overload(
333  object(from_stack(L, -1))
334  , name
335  , fn
336  );
337  }
338 
339  char const* name;
340  F f;
341  Policies policies;
342  };
343 
344 # ifdef BOOST_MSVC
345 # pragma pack(pop)
346 # endif
347 
348  template <class P, class T>
350  {
351  typedef P type;
352  };
353 
354  template <class T>
356  {
357  typedef std::auto_ptr<T> type;
358  };
359 
360  template <class Class, class Pointer, class Signature, class Policies>
362  {
363  constructor_registration(Policies const& policies)
364  : policies(policies)
365  {}
366 
367  void register_(lua_State* L) const
368  {
369  typedef typename default_pointer<Pointer, Class>::type pointer;
370 
371  object fn = make_function(
372  L
373  , construct<Class, pointer, Signature>(), Signature()
374  , policies
375  );
376 
377  add_overload(
378  object(from_stack(L, -1))
379  , "__init"
380  , fn
381  );
382  }
383 
384  Policies policies;
385  };
386 
387  template <class T>
389  : mpl::if_<
390  mpl::or_<boost::is_pointer<T>, is_primitive<T> >
391  , T
392  , typename boost::add_reference<T>::type
393  >
394  {};
395 
396  template <class T>
398  : mpl::if_<
399  mpl::or_<boost::is_pointer<T>, is_primitive<T> >
400  , T
401  , typename boost::add_reference<
402  typename boost::add_const<T>::type
403  >::type
404  >
405  {};
406 
407  template <class T, class Policies>
409  : mpl::if_<
410  mpl::or_<
411  is_primitive<T>
412  , has_policy<Policies, detail::no_dependency_policy>
413  >
414  , Policies
415  , policy_cons<dependency_policy<0, 1>, Policies>
416  >
417  {};
418 
419  template <
420  class Class
421  , class Get, class GetPolicies
422  , class Set = null_type, class SetPolicies = null_type
423  >
425  {
427  char const* name
428  , Get const& get
429  , GetPolicies const& get_policies
430  , Set const& set = Set()
431  , SetPolicies const& set_policies = SetPolicies()
432  )
433  : name(name)
434  , get(get)
435  , get_policies(get_policies)
436  , set(set)
437  , set_policies(set_policies)
438  {}
439 
440  void register_(lua_State* L) const
441  {
442  object context(from_stack(L, -1));
443  register_aux(
444  L
445  , context
446  , make_get(L, get, boost::is_member_object_pointer<Get>())
447  , set
448  );
449  }
450 
451  template <class F>
452  object make_get(lua_State* L, F const& f, mpl::false_) const
453  {
454  return make_function(
455  L, f, deduce_signature(f, (Class*)0), get_policies);
456  }
457 
458  template <class T, class D>
459  object make_get(lua_State* L, D T::* mem_ptr, mpl::true_) const
460  {
461  typedef typename reference_result<D>::type result_type;
462  typedef typename inject_dependency_policy<
463  D, GetPolicies>::type policies;
464 
465  return make_function(
466  L
468  , mpl::vector2<result_type, Class const&>()
469  , policies()
470  );
471  }
472 
473  template <class F>
474  object make_set(lua_State* L, F const& f, mpl::false_) const
475  {
476  return make_function(
477  L, f, deduce_signature(f, (Class*)0), set_policies);
478  }
479 
480  template <class T, class D>
481  object make_set(lua_State* L, D T::* mem_ptr, mpl::true_) const
482  {
483  typedef typename reference_argument<D>::type argument_type;
484 
485  return make_function(
486  L
487  , access_member_ptr<T, D>(mem_ptr)
488  , mpl::vector3<void, Class&, argument_type>()
489  , set_policies
490  );
491  }
492 
493  template <class S>
494  void register_aux(
495  lua_State* L, object const& context
496  , object const& get_, S const&) const
497  {
498  context[name] = property(
499  get_
500  , make_set(L, set, boost::is_member_object_pointer<Set>())
501  );
502  }
503 
504  void register_aux(
505  lua_State*, object const& context
506  , object const& get_, null_type) const
507  {
508  context[name] = property(get_);
509  }
510 
511  char const* name;
512  Get get;
513  GetPolicies get_policies;
514  Set set;
515  SetPolicies set_policies;
516  };
517 
518  } // namespace detail
519 
520  // registers a class in the lua environment
521  template<class T, class X1, class X2, class X3>
522  struct class_: detail::class_base
523  {
524  typedef class_<T, X1, X2, X3> self_t;
525 
526  private:
527 
528  template<class A, class B, class C, class D>
529  class_(const class_<A,B,C,D>&);
530 
531  public:
532 
533  typedef boost::mpl::vector4<X1, X2, X3, detail::unspecified> parameters_type;
534 
535  // WrappedType MUST inherit from T
536  typedef typename detail::extract_parameter<
537  parameters_type
538  , boost::is_base_and_derived<T, boost::mpl::_>
540  >::type WrappedType;
541 
542  typedef typename detail::extract_parameter<
543  parameters_type
544  , boost::mpl::not_<
545  boost::mpl::or_<
547  , boost::is_base_and_derived<boost::mpl::_, T>
548  , boost::is_base_and_derived<T, boost::mpl::_>
549  >
550  >
552  >::type HeldType;
553 
554  template <class Src, class Target>
555  void add_downcast(Src*, Target*, boost::mpl::true_)
556  {
557  add_cast(
561  );
562  }
563 
564  template <class Src, class Target>
565  void add_downcast(Src*, Target*, boost::mpl::false_)
566  {}
567 
568  // this function generates conversion information
569  // in the given class_rep structure. It will be able
570  // to implicitly cast to the given template type
571  template<class To>
572  void gen_base_info(detail::type_<To>)
573  {
574  add_base(typeid(To), detail::static_cast_<T, To>::execute);
575  add_cast(
579  );
580 
581  add_downcast((To*)0, (T*)0, boost::is_polymorphic<To>());
582  }
583 
584  void gen_base_info(detail::type_<detail::null_type>)
585  {}
586 
587 # ifndef LUABIND_CPP0x
588 
589 #define LUABIND_GEN_BASE_INFO(z, n, text) gen_base_info(detail::type_<BaseClass##n>());
590 
591  template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, class BaseClass)>
592  void generate_baseclass_list(detail::type_<bases<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, BaseClass)> >)
593  {
594  BOOST_PP_REPEAT(LUABIND_MAX_BASES, LUABIND_GEN_BASE_INFO, _)
595  }
596 
597 #undef LUABIND_GEN_BASE_INFO
598 
599 # else // !LUABIND_CPP0x
600 
601  template <class... Args>
602  void ignore(Args&&...)
603  {}
604 
605  template <class... Bases>
606  void generate_baseclass_list(detail::type_<bases<Bases...> >)
607  {
608  ignore((gen_base_info(detail::type_<Bases>()), 0)...);
609  }
610 
611 # endif // !LUABIND_CPP0x
612 
613  class_(const char* name): class_base(name), scope(*this)
614  {
615 #ifndef NDEBUG
616  detail::check_link_compatibility();
617 #endif
618  init();
619  }
620 
621  template<class F>
622  class_& def(const char* name, F f)
623  {
624  return this->virtual_def(
625  name, f, detail::null_type()
626  , detail::null_type(), boost::mpl::true_());
627  }
628 
629  // virtual functions
630  template<class F, class DefaultOrPolicies>
631  class_& def(char const* name, F fn, DefaultOrPolicies default_or_policies)
632  {
633  return this->virtual_def(
634  name, fn, default_or_policies, detail::null_type()
635  , LUABIND_MSVC_TYPENAME detail::is_policy_cons<DefaultOrPolicies>::type());
636  }
637 
638  template<class F, class Default, class Policies>
639  class_& def(char const* name, F fn
640  , Default default_, Policies const& policies)
641  {
642  return this->virtual_def(
643  name, fn, default_
644  , policies, boost::mpl::false_());
645  }
646 
647 # ifdef LUABIND_CPP0x
648 
649  template <class... Args, class Policies = detail::null_type>
650  class_& def(constructor<Args...>, Policies const& policies = Policies())
651  {
652  return this->def_constructor((constructor<Args...>*)0, policies);
653  }
654 
655 # else
656 
657  template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
658  class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig)
659  {
660  return this->def_constructor(&sig, detail::null_type());
661  }
662 
663  template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A), class Policies>
664  class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig, const Policies& policies)
665  {
666  return this->def_constructor(&sig, policies);
667  }
668 
669 # endif // LUABIND_CPP0x
670 
671  template <class Getter>
672  class_& property(const char* name, Getter g)
673  {
674  this->add_member(
676  name, g, detail::null_type()));
677  return *this;
678  }
679 
680  template <class Getter, class MaybeSetter>
681  class_& property(const char* name, Getter g, MaybeSetter s)
682  {
683  return property_impl(
684  name, g, s
685  , boost::mpl::bool_<detail::is_policy_cons<MaybeSetter>::value>()
686  );
687  }
688 
689  template<class Getter, class Setter, class GetPolicies>
690  class_& property(const char* name, Getter g, Setter s, const GetPolicies& get_policies)
691  {
693  T, Getter, GetPolicies, Setter, detail::null_type
694  > registration_type;
695 
696  this->add_member(
697  new registration_type(name, g, get_policies, s));
698  return *this;
699  }
700 
701  template<class Getter, class Setter, class GetPolicies, class SetPolicies>
702  class_& property(
703  const char* name
704  , Getter g, Setter s
705  , GetPolicies const& get_policies
706  , SetPolicies const& set_policies)
707  {
709  T, Getter, GetPolicies, Setter, SetPolicies
710  > registration_type;
711 
712  this->add_member(
713  new registration_type(name, g, get_policies, s, set_policies));
714  return *this;
715  }
716 
717  template <class C, class D>
718  class_& def_readonly(const char* name, D C::*mem_ptr)
719  {
721  registration_type;
722 
723  this->add_member(
724  new registration_type(name, mem_ptr, detail::null_type()));
725  return *this;
726  }
727 
728  template <class C, class D, class Policies>
729  class_& def_readonly(const char* name, D C::*mem_ptr, Policies const& policies)
730  {
732  registration_type;
733 
734  this->add_member(
735  new registration_type(name, mem_ptr, policies));
736  return *this;
737  }
738 
739  template <class C, class D>
740  class_& def_readwrite(const char* name, D C::*mem_ptr)
741  {
743  T, D C::*, detail::null_type, D C::*
744  > registration_type;
745 
746  this->add_member(
747  new registration_type(
748  name, mem_ptr, detail::null_type(), mem_ptr));
749  return *this;
750  }
751 
752  template <class C, class D, class GetPolicies>
753  class_& def_readwrite(
754  const char* name, D C::*mem_ptr, GetPolicies const& get_policies)
755  {
757  T, D C::*, GetPolicies, D C::*
758  > registration_type;
759 
760  this->add_member(
761  new registration_type(
762  name, mem_ptr, get_policies, mem_ptr));
763  return *this;
764  }
765 
766  template <class C, class D, class GetPolicies, class SetPolicies>
767  class_& def_readwrite(
768  const char* name
769  , D C::*mem_ptr
770  , GetPolicies const& get_policies
771  , SetPolicies const& set_policies
772  )
773  {
775  T, D C::*, GetPolicies, D C::*, SetPolicies
776  > registration_type;
777 
778  this->add_member(
779  new registration_type(
780  name, mem_ptr, get_policies, mem_ptr, set_policies));
781  return *this;
782  }
783 
784  template<class Derived, class Policies>
785  class_& def(detail::operator_<Derived>, Policies const& policies)
786  {
787  return this->def(
788  Derived::name()
789  , &Derived::template apply<T, Policies>::execute
790  , policies
791  );
792  }
793 
794  template<class Derived>
796  {
797  return this->def(
798  Derived::name()
799  , &Derived::template apply<T, detail::null_type>::execute
800  );
801  }
802 
803  detail::enum_maker<self_t> enum_(const char*)
804  {
805  return detail::enum_maker<self_t>(*this);
806  }
807 
809 
810  private:
811  void operator=(class_ const&);
812 
813  void add_wrapper_cast(detail::null_type*)
814  {}
815 
816  template <class U>
817  void add_wrapper_cast(U*)
818  {
819  add_cast(
823  );
824 
825  add_downcast((T*)0, (U*)0, boost::is_polymorphic<T>());
826  }
827 
828  void init()
829  {
830  typedef typename detail::extract_parameter<
831  parameters_type
832  , boost::mpl::or_<
833  detail::is_bases<boost::mpl::_>
834  , boost::is_base_and_derived<boost::mpl::_, T>
835  >
836  , no_bases
837  >::type bases_t;
838 
839  typedef typename
840  boost::mpl::if_<detail::is_bases<bases_t>
841  , bases_t
843  >::type Base;
844 
845  class_base::init(
846  typeid(T)
848  , typeid(WrappedType)
850  );
851 
852  add_wrapper_cast((WrappedType*)0);
853 
854  generate_baseclass_list(detail::type_<Base>());
855  }
856 
857  template<class Getter, class GetPolicies>
858  class_& property_impl(const char* name,
859  Getter g,
860  GetPolicies policies,
861  boost::mpl::bool_<true>)
862  {
863  this->add_member(
865  name, g, policies));
866  return *this;
867  }
868 
869  template<class Getter, class Setter>
870  class_& property_impl(const char* name,
871  Getter g,
872  Setter s,
873  boost::mpl::bool_<false>)
874  {
876  T, Getter, detail::null_type, Setter, detail::null_type
877  > registration_type;
878 
879  this->add_member(
880  new registration_type(name, g, detail::null_type(), s));
881  return *this;
882  }
883 
884  // these handle default implementation of virtual functions
885  template<class F, class Policies>
886  class_& virtual_def(char const* name, F const& fn
887  , Policies const&, detail::null_type, boost::mpl::true_)
888  {
889  this->add_member(
891  name, fn, Policies()));
892  return *this;
893  }
894 
895  template<class F, class Default, class Policies>
896  class_& virtual_def(char const* name, F const& fn
897  , Default const& default_, Policies const&, boost::mpl::false_)
898  {
899  this->add_member(
901  name, fn, Policies()));
902 
903  this->add_default_member(
905  name, default_, Policies()));
906 
907  return *this;
908  }
909 
910  template<class Signature, class Policies>
911  class_& def_constructor(Signature*, Policies const&)
912  {
913  typedef typename Signature::signature signature;
914 
915  typedef typename boost::mpl::if_<
916  boost::is_same<WrappedType, detail::null_type>
917  , T
918  , WrappedType
919  >::type construct_type;
920 
921  this->add_member(
923  construct_type, HeldType, signature, Policies>(
924  Policies()));
925 
926  this->add_default_member(
928  construct_type, HeldType, signature, Policies>(
929  Policies()));
930 
931  return *this;
932  }
933  };
934 
935 }
936 
937 #ifdef _MSC_VER
938 #pragma warning(pop)
939 #endif
940 
941 #endif // LUABIND_CLASS_HPP_INCLUDED
942 
Definition: signature_match.hpp:58
Definition: class.hpp:388
Definition: class.cpp:61
Definition: basic_dir_monitor.hpp:13
Definition: inheritance.hpp:141
Definition: property.hpp:11
Definition: class.hpp:259
Definition: enum_maker.hpp:94
Definition: class.hpp:170
Definition: typeid.hpp:22
Definition: class.hpp:132
Definition: class.hpp:248
Definition: inheritance.hpp:132
Definition: inheritance.hpp:153
Definition: class.hpp:207
Definition: class.hpp:124
Definition: class.hpp:222
Definition: minilua.c:461
Definition: class.hpp:280
Definition: scope.hpp:39
Definition: class.hpp:134
Definition: policy.hpp:140
Definition: PEtypes.h:507
Definition: class.hpp:234
Definition: constructor.hpp:66
Definition: class.hpp:319
Definition: class.hpp:140
Definition: primitives.hpp:42
Definition: scope.hpp:56
Definition: primitives.hpp:44
Definition: class.hpp:397
Definition: class.hpp:197
Definition: class.hpp:216
Definition: class.hpp:349
Definition: class.hpp:180
Definition: from_stack.hpp:28