Wrap std::list::empty as isEmpty in Java
This commit is contained in:
parent
109a60add6
commit
990c597365
2 changed files with 7 additions and 1 deletions
|
|
@ -16,7 +16,12 @@ public class li_std_list_runme {
|
||||||
IntList v1 = new IntList();
|
IntList v1 = new IntList();
|
||||||
DoubleList v2 = new DoubleList();
|
DoubleList v2 = new DoubleList();
|
||||||
|
|
||||||
v1.add(123);
|
if (!v1.isEmpty()) throw new RuntimeException("v1 test (1) failed");
|
||||||
|
if (v1.size() != 0) throw new RuntimeException("v1 test (2) failed");
|
||||||
|
if (!v1.add(123)) throw new RuntimeException("v1 test (3) failed");
|
||||||
|
if (v1.size() != 1) throw new RuntimeException("v1 test (4) failed");
|
||||||
|
if (v1.isEmpty()) throw new RuntimeException("v1 test (5) failed");
|
||||||
|
|
||||||
if (v1.get(0) != 123) throw new RuntimeException("v1 test failed");
|
if (v1.get(0) != 123) throw new RuntimeException("v1 test failed");
|
||||||
|
|
||||||
StructList v4 = new StructList();
|
StructList v4 = new StructList();
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@ namespace std {
|
||||||
list(const list &o);
|
list(const list &o);
|
||||||
~list();
|
~list();
|
||||||
void assign(size_type n, const value_type &val);
|
void assign(size_type n, const value_type &val);
|
||||||
|
%rename(isEmpty) empty;
|
||||||
bool empty() const;
|
bool empty() const;
|
||||||
size_type max_size() const;
|
size_type max_size() const;
|
||||||
void pop_back();
|
void pop_back();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue