|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include STR_STREAM
|
|
|
|
|
#include <sstream>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <iterator>
|
|
|
|
|
#include <utility>
|
|
|
|
@ -30,10 +30,10 @@ namespace Py
|
|
|
|
|
// Forward declarations
|
|
|
|
|
class Object;
|
|
|
|
|
class Type;
|
|
|
|
|
template<TEMPLATE_TYPENAME T> class SeqBase;
|
|
|
|
|
template<typename T> class SeqBase;
|
|
|
|
|
class String;
|
|
|
|
|
class List;
|
|
|
|
|
template<TEMPLATE_TYPENAME T> class MapBase;
|
|
|
|
|
template<typename T> class MapBase;
|
|
|
|
|
|
|
|
|
|
// new_reference_to also overloaded below on Object
|
|
|
|
|
inline PyObject* new_reference_to(PyObject* p)
|
|
|
|
@ -837,7 +837,7 @@ namespace Py
|
|
|
|
|
// Changing them to Object(x[i]) helps the compiler to understand that the
|
|
|
|
|
// conversion of a seqref to an Object is wanted.
|
|
|
|
|
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
class seqref
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
@ -1027,7 +1027,7 @@ namespace Py
|
|
|
|
|
// class SeqBase<T>
|
|
|
|
|
// ...the base class for all sequence types
|
|
|
|
|
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
class SeqBase: public Object
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -1289,7 +1289,7 @@ namespace Py
|
|
|
|
|
|
|
|
|
|
std::string diagnose() const
|
|
|
|
|
{
|
|
|
|
|
std::OSTRSTREAM oss;
|
|
|
|
|
std::ostringstream oss;
|
|
|
|
|
oss << "iterator diagnosis " << seq << ", " << count << std::ends;
|
|
|
|
|
return std::string(oss.str());
|
|
|
|
|
}
|
|
|
|
@ -1436,19 +1436,19 @@ namespace Py
|
|
|
|
|
// Here's an important typedef you might miss if reading too fast...
|
|
|
|
|
typedef SeqBase<Object> Sequence;
|
|
|
|
|
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator==(const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator!=(const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator< (const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator> (const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator<=(const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator>=(const EXPLICIT_TYPENAME SeqBase<T>::iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator==(const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator!=(const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator< (const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator> (const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator<=(const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator>=(const typename SeqBase<T>::iterator& left, const typename SeqBase<T>::iterator& right);
|
|
|
|
|
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator==(const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator!=(const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator< (const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator> (const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator<=(const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator>=(const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& left, const EXPLICIT_TYPENAME SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator==(const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator!=(const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator< (const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator> (const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator<=(const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator>=(const typename SeqBase<T>::const_iterator& left, const typename SeqBase<T>::const_iterator& right);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern bool operator==(const Sequence::iterator& left, const Sequence::iterator& right);
|
|
|
|
@ -1916,7 +1916,7 @@ namespace Py
|
|
|
|
|
|
|
|
|
|
// Mappings
|
|
|
|
|
// ==================================================
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
class mapref
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
@ -2085,7 +2085,7 @@ namespace Py
|
|
|
|
|
return true; // not completed.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
class MapBase: public Object
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
@ -2372,7 +2372,7 @@ namespace Py
|
|
|
|
|
|
|
|
|
|
std::string diagnose() const
|
|
|
|
|
{
|
|
|
|
|
std::OSTRSTREAM oss;
|
|
|
|
|
std::ostringstream oss;
|
|
|
|
|
oss << "iterator diagnosis " << map << ", " << pos << std::ends;
|
|
|
|
|
return std::string(oss.str());
|
|
|
|
|
}
|
|
|
|
@ -2477,10 +2477,10 @@ namespace Py
|
|
|
|
|
|
|
|
|
|
typedef MapBase<Object> Mapping;
|
|
|
|
|
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator==(const EXPLICIT_TYPENAME MapBase<T>::iterator& left, const EXPLICIT_TYPENAME MapBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator!=(const EXPLICIT_TYPENAME MapBase<T>::iterator& left, const EXPLICIT_TYPENAME MapBase<T>::iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator==(const EXPLICIT_TYPENAME MapBase<T>::const_iterator& left, const EXPLICIT_TYPENAME MapBase<T>::const_iterator& right);
|
|
|
|
|
template <TEMPLATE_TYPENAME T> bool operator!=(const EXPLICIT_TYPENAME MapBase<T>::const_iterator& left, const EXPLICIT_TYPENAME MapBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator==(const typename MapBase<T>::iterator& left, const typename MapBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator!=(const typename MapBase<T>::iterator& left, const typename MapBase<T>::iterator& right);
|
|
|
|
|
template <typename T> bool operator==(const typename MapBase<T>::const_iterator& left, const typename MapBase<T>::const_iterator& right);
|
|
|
|
|
template <typename T> bool operator!=(const typename MapBase<T>::const_iterator& left, const typename MapBase<T>::const_iterator& right);
|
|
|
|
|
|
|
|
|
|
extern bool operator==(const Mapping::iterator& left, const Mapping::iterator& right);
|
|
|
|
|
extern bool operator!=(const Mapping::iterator& left, const Mapping::iterator& right);
|
|
|
|
@ -2787,13 +2787,13 @@ namespace Py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
String seqref<T>::str () const
|
|
|
|
|
{
|
|
|
|
|
return the_item.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<TEMPLATE_TYPENAME T>
|
|
|
|
|
template<typename T>
|
|
|
|
|
String seqref<T>::repr () const
|
|
|
|
|
{
|
|
|
|
|
return the_item.repr();
|
|
|
|
|