Merge branch 'unique_ptr'
* unique_ptr: Add std::unique_ptr<type> to Perl5.
This commit is contained in:
commit
3cbcdbf681
3 changed files with 37 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
%module cpp11_std_unique_ptr
|
||||
|
||||
#if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGPYTHON) || defined(SWIGRUBY)
|
||||
#if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGPERL)
|
||||
|
||||
%include "std_unique_ptr.i"
|
||||
|
||||
|
|
|
|||
17
Examples/test-suite/perl5/cpp11_std_unique_ptr_runme.pl
Normal file
17
Examples/test-suite/perl5/cpp11_std_unique_ptr_runme.pl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 6;
|
||||
BEGIN { use_ok('cpp11_std_unique_ptr') }
|
||||
require_ok('cpp11_std_unique_ptr');
|
||||
|
||||
my $k1 = cpp11_std_unique_ptr::makeKlassUniquePtr("first");
|
||||
my $k2 = cpp11_std_unique_ptr::makeKlassUniquePtr("second");
|
||||
is(cpp11_std_unique_ptr::Klass::getTotal_count, 2, "have 2 pointers");
|
||||
|
||||
undef $k1;
|
||||
is(cpp11_std_unique_ptr::Klass::getTotal_count, 1, "left 1 pointer");
|
||||
|
||||
is($k2->getLabel, "second", "proper label");
|
||||
|
||||
undef $k2;
|
||||
is(cpp11_std_unique_ptr::Klass::getTotal_count, 0, "remove all pointers");
|
||||
Loading…
Add table
Add a link
Reference in a new issue