summaryrefslogtreecommitdiff
path: root/include/gras/element.i
diff options
context:
space:
mode:
Diffstat (limited to 'include/gras/element.i')
-rw-r--r--include/gras/element.i22
1 files changed, 9 insertions, 13 deletions
diff --git a/include/gras/element.i b/include/gras/element.i
index e2da4ae..72d9f25 100644
--- a/include/gras/element.i
+++ b/include/gras/element.i
@@ -19,24 +19,20 @@
%include <gras/element.hpp>
////////////////////////////////////////////////////////////////////////
-// Create a __str__ for this object
+// Operator overloads for Element
////////////////////////////////////////////////////////////////////////
-
-namespace gras
+%extend gras::Element
{
- %extend Element
+ std::string __str__(void) const
{
- std::string __str__(void)
- {
- return ($self)->to_string();
- }
-
- bool __eq__(const Element &rhs)
- {
- return ($self)->get() == rhs.get();
- }
+ return ($self)->to_string();
+ }
+ bool __eq__(const Element &rhs) const
+ {
+ return ($self)->get() == rhs.get();
}
+
}
#endif /*INCLUDED_GRAS_ELEMENT_I*/