- class IteratorOnPtr : public implem_iop::IteratorOnPtr_base {
- typedef implem_iop::IteratorOnPtr_base
parent_type;
- enum {
- STEP = parent_type::STEP
- };
- public:
- typedef typename parent_type::iterator_category iterator_category;
- typedef typename parent_type::value_type value_type;
- typedef typename parent_type::difference_type difference_type;
- typedef typename parent_type::pointer pointer;
- typedef typename parent_type::reference reference;
-
- IteratorOnPtr ( void );
- IteratorOnPtr ( P parPointer, difference_type parSize );
- IteratorOnPtr ( const IteratorOnPtr& parOther ) : parent_type(parOther) { return; }
- template
- IteratorOnPtr ( const IteratorOnPtr& parOther ) : parent_type(parOther) {}
- ~IteratorOnPtr ( void );
-
- IteratorOnPtr& operator++ ( void ); //pre
- IteratorOnPtr operator++ ( int ); //post
- IteratorOnPtr& operator-- ( void );
- IteratorOnPtr operator-- ( int );
- reference operator* ( void );
- pointer operator-> ( void );
-
- using parent_type::operator-;
- IteratorOnPtr operator+ ( difference_type parOther ) const;
- IteratorOnPtr operator- ( difference_type parOther ) const;
- IteratorOnPtr& operator+= ( difference_type parOther );
- IteratorOnPtr& operator-= ( difference_type parOther );
- protected:
- private:
- };
-
- namespace implem_iop {
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
-#if !defined(NDEBUG)
- IteratorOnPtr_base::IteratorOnPtr_base (P parPointer, difference_type parSize) :
- m_pointer(parPointer),
- m_size(parSize)
-#else
- IteratorOnPtr_base
::IteratorOnPtr_base (P parPointer, difference_type) :
- m_pointer(parPointer)
-#endif
- {
- static_assert(I != 0, "Step must be non-zero");
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- template
- IteratorOnPtr_base::IteratorOnPtr_base (const IteratorOnPtr_base& parOther) {
- m_pointer = parOther.GetPointer();
-#if !defined(NDEBUG)
- m_size = parOther.GetSize();
-#endif
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- IteratorOnPtr_base::IteratorOnPtr_base (const IteratorOnPtr_base& parOther) {
- m_pointer = parOther.m_pointer;
-#if !defined(NDEBUG)
- m_size = parOther.m_size;
-#endif
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- IteratorOnPtr_base::~IteratorOnPtr_base() {
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- typename IteratorOnPtr_base::difference_type IteratorOnPtr_base
::operator- (const IteratorOnPtr_base& parOther) const {
- if (I > 0)
- return m_pointer - parOther.m_pointer;
- else
- return parOther.m_pointer - m_pointer;
- }
-
-#if !defined(NDEBUG)
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- typename IteratorOnPtr_base::difference_type IteratorOnPtr_base
::GetSize (difference_type parAdvance) const {
- return m_size - STEP * parAdvance;
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- bool IteratorOnPtr_base::CanAdvance (difference_type parAdvance) const {
- return (m_size >= STEP * parAdvance);
- }
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- void IteratorOnPtr_base::AlterSize (difference_type parAdvance) {
- m_size = GetSize(parAdvance);
- }
-#endif
-
- ///---------------------------------------------------------------------
- ///---------------------------------------------------------------------
- template
- void IteratorOnPtr_base::MoveIterator (difference_type parAdvance) {
-#if !defined(NDEBUG)
- assert(CanAdvance(parAdvance));
- AlterSize(parAdvance);
-#endif
- m_pointer += I * parAdvance;
- }
- } //namespace implem_iop
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr::IteratorOnPtr() :
- parent_type(NULL, 0)
- {
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr::IteratorOnPtr (P parPointer, difference_type parSize) :
- parent_type(parPointer, parSize)
- {
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr::~IteratorOnPtr() {
- }
-
- ///-------------------------------------------------------------------------
- ///Pre-increment.
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr& IteratorOnPtr
::operator++() {
- this->MoveIterator(1);
- return *this;
- }
-
- ///-------------------------------------------------------------------------
- ///Post-increment.
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr IteratorOnPtr
::operator++ (int) {
- IteratorOnPtr
retVal(*this);
- this->MoveIterator(1);
- return retVal;
- }
-
- ///-------------------------------------------------------------------------
- ///Pre-decrement.
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr& IteratorOnPtr
::operator--() {
- this->MoveIterator(-1);
- return *this;
- }
-
- ///-------------------------------------------------------------------------
- ///Post-decrement.
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr IteratorOnPtr
::operator-- (int) {
- IteratorOnPtr
retVal(*this);
- this->MoveIterator(-1);
- return retVal;
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- typename IteratorOnPtr::reference IteratorOnPtr
::operator*() {
- return *(this->m_pointer);
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- typename IteratorOnPtr::pointer IteratorOnPtr
::operator->() {
- return this->m_pointer;
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr IteratorOnPtr
::operator+ (difference_type parOther) const {
- IteratorOnPtr
retVal(*this);
- retVal += parOther;
- return retVal;
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr IteratorOnPtr
::operator- (difference_type parOther) const {
- IteratorOnPtr
retVal(*this);
- retVal -= parOther;
- return retVal;
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr& IteratorOnPtr
::operator+= (difference_type parOther) {
- this->MoveIterator(parOther);
- return *this;
- }
-
- ///-------------------------------------------------------------------------
- ///-------------------------------------------------------------------------
- template
- IteratorOnPtr& IteratorOnPtr
::operator-= (difference_type parOther) {
- this->MoveIterator(-parOther);
- return *this;
- }
-} //namespace dinhelp
-
-#endif
diff --git a/include/helpers/infix_iterator.hpp b/include/helpers/infix_iterator.hpp
deleted file mode 100644
index ca65e34..0000000
--- a/include/helpers/infix_iterator.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// see http://stackoverflow.com/questions/3496982/printing-lists-with-commas-c/3497021#3497021
-// infix_iterator.h
-//
-// Lifted from Jerry Coffin's 's prefix_ostream_iterator
-#if !defined(INFIX_ITERATOR_H_)
-#define INFIX_ITERATOR_H_
-#include
-#include
-template >
-class infix_ostream_iterator :
- public std::iterator
-{
- std::basic_ostream *os;
- charT const* delimiter;
- bool first_elem;
-public:
- typedef charT char_type;
- typedef traits traits_type;
- typedef std::basic_ostream ostream_type;
- infix_ostream_iterator(ostream_type& s)
- : os(&s),delimiter(0), first_elem(true)
- {}
- infix_ostream_iterator(ostream_type& s, charT const *d)
- : os(&s),delimiter(d), first_elem(true)
- {}
- infix_ostream_iterator& operator=(T const &item)
- {
- // Here's the only real change from ostream_iterator:
- // Normally, the '*os << item;' would come before the 'if'.
- if (!first_elem && delimiter != 0)
- *os << delimiter;
- *os << item;
- first_elem = false;
- return *this;
- }
- infix_ostream_iterator &operator*() {
- return *this;
- }
- infix_ostream_iterator &operator++() {
- return *this;
- }
- infix_ostream_iterator &operator++(int) {
- return *this;
- }
-};
-#endif
diff --git a/include/helpers/lengthof.h b/include/helpers/lengthof.h
deleted file mode 100644
index 45e78c3..0000000
--- a/include/helpers/lengthof.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2015, 2016, Michele Santullo
- * This file is part of "dindexer".
- *
- * "dindexer" is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * "dindexer" is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with "dindexer". If not, see .
- */
-
-#ifndef id19B690A53A9546D5BD95D89FFF388283
-#define id19B690A53A9546D5BD95D89FFF388283
-
-#if defined(__cplusplus)
-# include
-#else
-# include
-#endif
-
-#if defined(lengthof)
-# undef lengthof
-#endif
-//http://stackoverflow.com/questions/4415524/common-array-length-macro-for-c#4415646
-#if defined(__cplusplus)
-# define lengthof(x) ((sizeof(x)/sizeof(0[x])) / ((std::size_t)(!(sizeof(x) % sizeof(0[x])))))
-#else
-# define lengthof(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
-#endif
-
-#endif
diff --git a/include/helpers/lexical_cast.hpp b/include/helpers/lexical_cast.hpp
deleted file mode 100644
index f5bced8..0000000
--- a/include/helpers/lexical_cast.hpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Copyright 2015, 2016, Michele Santullo
- * This file is part of "dindexer".
- *
- * "dindexer" is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * "dindexer" is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with "dindexer". If not, see .
- */
-
-#ifndef id942A6B5AB2AF443C82D4321775BFC9E8
-#define id942A6B5AB2AF443C82D4321775BFC9E8
-
-#include "compatibility.h"
-#include "helpers/sequence_bt.hpp"
-#include "helpers/MaxSizedArray.hpp"
-#include "sprout/math/log10.hpp"
-#include "sprout/math/log2.hpp"
-#include "sprout/math/pow.hpp"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace dinhelp {
- namespace customize {
- template
- struct index_array_to_string;
-
- template
- struct char_to_int;
- } //namespace customize
-
- namespace implem {
- template
- typename std::make_unsigned::type abs ( T parValue ) a_pure;
-
- template int count_leading_zeroes ( typename std::enable_if::is_signed, T>::type parValue ) a_always_inline;
- template int count_leading_zeroes ( typename std::enable_if::is_signed, T>::type parValue ) a_always_inline;
- int count_leading_zeroes_overload ( unsigned char parValue ) a_always_inline;
- int count_leading_zeroes_overload ( unsigned short int parValue ) a_always_inline;
- int count_leading_zeroes_overload ( unsigned int parValue ) a_always_inline;
- int count_leading_zeroes_overload ( unsigned long parValue ) a_always_inline;
- int count_leading_zeroes_overload ( unsigned long long parValue ) a_always_inline;
-
- template
- struct power {
- enum { value = Base * power::value };
- };
- template
- struct power {
- enum { value = 1 };
- };
-
- template ::is_signed>
- struct is_negative;
- template
- struct is_negative {
- static int check (T parValue) { return (parValue < 0 ? 1 : 0); }
- };
- template
- struct is_negative {
- static constexpr int check (T) { return 0; }
- };
-
- template class Tag, typename T, typename F>
- inline auto int_to_string (const F parFrom) -> MaxSizedArray::count_digits_bt(std::numeric_limits::type>::max())> {
- using ArrayRetType = MaxSizedArray::count_digits_bt(std::numeric_limits::type>::max())>;
-
- ArrayRetType retval;
- F div = 1;
- constexpr const std::size_t charset_offs = (Tag::lower_case ? Tag::base : 0);
- const auto sign_length = (is_negative::check(parFrom) and Tag::sign_allowed ? 1 : 0);
- for (std::size_t z = 0; z < Tag::count_digits(parFrom) - sign_length; ++z) {
- retval.push_back(static_cast(((Tag::make_unsigned(parFrom) / div) % Tag::base) + charset_offs));
- div *= Tag::base;
- }
- std::reverse(retval.begin(), retval.end());
- return retval;
- };
-
- template class Tag, typename T, typename F>
- inline T string_to_int (const F& parFrom) {
- T retval(0);
- T mul(1);
- for (auto chara : boost::adaptors::reverse(parFrom)) {
- retval += dinhelp::customize::char_to_int::make(chara) * mul;
- mul *= Tag