diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-11 15:09:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-11 15:09:17 +0200 |
commit | f8bb2faef4b272ed150eb3ca4cedaa79da410694 (patch) | |
tree | fff08a4d3ce6380709c84dc6b93d02de097dd7d5 /tests/cxx | |
parent | da1ce0f39a36a2fca1f8d51a67b92be6368ddbfd (diff) |
Allow initialization of pod_seq and fix_seq from a C array
Use this in the hybrid/binary/custom example.
Diffstat (limited to 'tests/cxx')
-rw-r--r-- | tests/cxx/hybrid/sequences/driver.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/cxx/hybrid/sequences/driver.cxx b/tests/cxx/hybrid/sequences/driver.cxx index 3d6c702..1a27e9b 100644 --- a/tests/cxx/hybrid/sequences/driver.cxx +++ b/tests/cxx/hybrid/sequences/driver.cxx @@ -85,6 +85,10 @@ main () s.push_back (222); s.push_back (333); assert (s.size () == 3 && s[0] == 111 && s[1] == 222 && s[2] == 333); + + pod c; + c.assign (s.begin (), s.size ()); + assert (c.size () == 3 && c[0] == 111 && c[1] == 222 && c[2] == 333); } { @@ -158,6 +162,11 @@ main () s.push_back ("ccc"); assert (s.size () == 3 && s[0] == "aaa" && s[1] == "bbb" && s[2] == "ccc"); + + fix c; + c.assign (s.begin (), s.size ()); + assert (c.size () == 3 && c[0] == "aaa" && + c[1] == "bbb" && c[2] == "ccc"); } { |