projects
/
mussa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
basic wrapping of Annotations
[mussa.git]
/
py
/
stl_container_adapter.hpp
diff --git
a/py/stl_container_adapter.hpp
b/py/stl_container_adapter.hpp
index f60c9960583d51a39d453f67f22e33a078666ad6..37f66fe64d56b7daabd11d7e12ccc1512f78dcfe 100644
(file)
--- a/
py/stl_container_adapter.hpp
+++ b/
py/stl_container_adapter.hpp
@@
-81,16
+81,16
@@
struct map_item
{
typedef typename T::key_type K;
typedef typename T::mapped_type V;
{
typedef typename T::key_type K;
typedef typename T::mapped_type V;
- static V& get(T
const
& x, K const& i)
+ static V& get(T & x, K const& i)
{
if( x.find(i) != x.end() ) return x[i];
throw KeyError();
}
{
if( x.find(i) != x.end() ) return x[i];
throw KeyError();
}
- static void set(T
const
& x, K const& i, V const& v)
+ static void set(T & x, K const& i, V const& v)
{
x[i]=v; // use map autocreation feature
}
{
x[i]=v; // use map autocreation feature
}
- static void del(T
const
& x, K const& i)
+ static void del(T & x, K const& i)
{
if( x.find(i) != x.end() ) x.erase(i);
else throw KeyError();
{
if( x.find(i) != x.end() ) x.erase(i);
else throw KeyError();
@@
-102,28
+102,28
@@
struct map_item
static boost::python::list keys(T const& x)
{
boost::python::list t;
static boost::python::list keys(T const& x)
{
boost::python::list t;
- for(typename T::const_iterator it=x.begin; it!=x.end(); ++it)
+ for(typename T::const_iterator it=x.begin
()
; it!=x.end(); ++it)
t.append(it->first);
return t;
}
static boost::python::list values(T const& x)
{
boost::python::list t;
t.append(it->first);
return t;
}
static boost::python::list values(T const& x)
{
boost::python::list t;
- for(typename T::const_iterator it=x.begin; it!=x.end(); ++it)
+ for(typename T::const_iterator it=x.begin
()
; it!=x.end(); ++it)
t.append(it->second);
return t;
}
static boost::python::list items(T const& x)
{
boost::python::list t;
t.append(it->second);
return t;
}
static boost::python::list items(T const& x)
{
boost::python::list t;
- for(typename T::const_iterator it=x.begin; it!=x.end(); ++it)
+ for(typename T::const_iterator it=x.begin
()
; it!=x.end(); ++it)
t.append(boost::python::make_tuple(it->first,it->second));
return t;
}
static int index(T const& x, K const& k)
{
int i=0;
t.append(boost::python::make_tuple(it->first,it->second));
return t;
}
static int index(T const& x, K const& k)
{
int i=0;
- for(typename T::const_iterator it=x.begin; it!=x.end(); ++it,++i)
+ for(typename T::const_iterator it=x.begin
()
; it!=x.end(); ++it,++i)
if( it->first == k ) return i;
return -1;
}
if( it->first == k ) return i;
return -1;
}