diff options
author | Takashi Tamura <tamuratak@users.noreply.github.com> | 2017-04-21 22:56:13 +0900 |
---|---|---|
committer | Takashi Tamura <tamuratak@users.noreply.github.com> | 2017-04-21 22:56:13 +0900 |
commit | 31459d0cc070c294e6f7465ef68b262c634bbdbd (patch) | |
tree | 51da4be376f86d6316ff9b197e41d5e8f243a0cc /Examples | |
parent | 6672338cc0d74c68c6738c53ba7de06a83b1efaa (diff) | |
download | swig-31459d0cc070c294e6f7465ef68b262c634bbdbd.tar.gz |
[ruby] use boost/shared_ptr and boost_shared_ptr.i. not use auto.
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/cpp11_shared_ptr_director.i | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Examples/test-suite/cpp11_shared_ptr_director.i b/Examples/test-suite/cpp11_shared_ptr_director.i index 0f0554134..0a8a2494f 100644 --- a/Examples/test-suite/cpp11_shared_ptr_director.i +++ b/Examples/test-suite/cpp11_shared_ptr_director.i @@ -1,10 +1,10 @@ %module(directors="1") "cpp11_shared_ptr_director" %{ -#include <memory> +#include <boost/shared_ptr.hpp> %} -%include "std_shared_ptr.i"; +%include "boost_shared_ptr.i"; %shared_ptr(C); %feature("director") Base; @@ -18,18 +18,18 @@ struct C { struct Base { Base() {}; - virtual std::shared_ptr<C> ret_c_shared_ptr() = 0; + virtual boost::shared_ptr<C> ret_c_shared_ptr() = 0; virtual C ret_c_by_value() = 0; virtual int take_c_by_value(C c) = 0; - virtual int take_c_shared_ptr_by_value(std::shared_ptr<C> c) = 0; - virtual int take_c_shared_ptr_by_ref(std::shared_ptr<C>& c) = 0; - virtual int take_c_shared_ptr_by_pointer(std::shared_ptr<C>* c) = 0; - virtual int take_c_shared_ptr_by_pointer_ref(std::shared_ptr<C>*const&c) = 0; + virtual int take_c_shared_ptr_by_value(boost::shared_ptr<C> c) = 0; + virtual int take_c_shared_ptr_by_ref(boost::shared_ptr<C>& c) = 0; + virtual int take_c_shared_ptr_by_pointer(boost::shared_ptr<C>* c) = 0; + virtual int take_c_shared_ptr_by_pointer_ref(boost::shared_ptr<C>*const&c) = 0; virtual ~Base() {} }; int call_ret_c_shared_ptr(Base* b) { - std::shared_ptr<C> ptr = b->ret_c_shared_ptr(); + boost::shared_ptr<C> ptr = b->ret_c_shared_ptr(); if (ptr) { return ptr->get_m(); } else { @@ -48,42 +48,42 @@ int call_take_c_by_value(Base* b) { } int call_take_c_shared_ptr_by_value(Base* b) { - std::shared_ptr<C> ptr(new C(6)); + boost::shared_ptr<C> ptr(new C(6)); return b->take_c_shared_ptr_by_value(ptr); } int call_take_c_shared_ptr_by_value_with_null(Base* b) { - std::shared_ptr<C> ptr; + boost::shared_ptr<C> ptr; return b->take_c_shared_ptr_by_value(ptr); } int call_take_c_shared_ptr_by_ref(Base* b) { - std::shared_ptr<C> ptr(new C(7)); + boost::shared_ptr<C> ptr(new C(7)); return b->take_c_shared_ptr_by_ref(ptr); } int call_take_c_shared_ptr_by_ref_with_null(Base* b) { - std::shared_ptr<C> ptr; + boost::shared_ptr<C> ptr; return b->take_c_shared_ptr_by_ref(ptr); } int call_take_c_shared_ptr_by_pointer(Base* b) { - std::shared_ptr<C> ptr(new C(8)); + boost::shared_ptr<C> ptr(new C(8)); return b->take_c_shared_ptr_by_pointer(&ptr); } int call_take_c_shared_ptr_by_pointer_with_null(Base* b) { - std::shared_ptr<C> ptr; + boost::shared_ptr<C> ptr; return b->take_c_shared_ptr_by_pointer(&ptr); } int call_take_c_shared_ptr_by_pointer_ref(Base* b) { - auto ptr = new std::shared_ptr<C>(new C(9)); + boost::shared_ptr<C> *ptr = new boost::shared_ptr<C>(new C(9)); return b->take_c_shared_ptr_by_pointer_ref(ptr); } int call_take_c_shared_ptr_by_pointer_ref_with_null(Base* b) { - auto ptr = new std::shared_ptr<C>(); + boost::shared_ptr<C> *ptr = new boost::shared_ptr<C>(); return b->take_c_shared_ptr_by_pointer_ref(ptr); } |