reference_type dereference() const {
        return unescape<xml_unescape<Base>, Base>::dereference();
    }
public:
    // workaround msvc 7.1 ICU crash
    #if defined(POTHOS_MSVC)
        typedef int value_type;
    #else
        typedef POTHOS_DEDUCED_TYPENAME this_t::value_type value_type;
    #endif

    void drain_residue(const char *literal);
    value_type drain();

    template<class T>
    xml_unescape(POTHOS_PFTO_WRAPPER(T) start) : 
        super_t(Base(POTHOS_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
    {}
    // intel 7.1 doesn't like default copy constructor
    xml_unescape(const xml_unescape & rhs) : 
        super_t(rhs.base_reference())
    {}
};

template<class Base>
void xml_unescape<Base>::drain_residue(const char * literal){
    do{
        if(* literal != * ++(this->base_reference()))
            Pothos::serialization::throw_exception(
                dataflow_exception(
                    dataflow_exception::invalid_xml_escape_sequence
        return const_cast<this_t *>(this)->dereference_impl();
    }

    void increment(){
        dereference_impl();
        m_full = false;
        ++(this->base_reference());
    };

    wchar_t m_current_value;
    bool m_full;

public:
    // make composible buy using templated constructor
    template<class T>
    wchar_from_mb(POTHOS_PFTO_WRAPPER(T) start) : 
        super_t(Base(POTHOS_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
        m_full(false)
    {}
    // intel 7.1 doesn't like default copy constructor
    wchar_from_mb(const wchar_from_mb & rhs) : 
        super_t(rhs.base_reference()),
        m_full(rhs.m_full)
    {}
};

template<class Base>
wchar_t wchar_from_mb<Base>::drain(){
    char buffer[9];
    char * bptr = buffer;
    char val;
        m_bend = 
        m_bnext = 0;
        ++(this->base_reference());
        m_full = false;
    }

    // buffer to handle pending characters
    int m_bend;
    int m_bnext;
    char m_buffer[9];
    bool m_full;

public:
    // make composible buy using templated constructor
    template<class T>
    mb_from_wchar(POTHOS_PFTO_WRAPPER(T) start) :
        super_t(Base(POTHOS_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
        m_bend(0),
        m_bnext(0),
        m_full(false)
    {}
    // intel 7.1 doesn't like default copy constructor
    mb_from_wchar(const mb_from_wchar & rhs) : 
        super_t(rhs.base_reference()),
        m_bend(rhs.m_bend),
        m_bnext(rhs.m_bnext),
        m_full(rhs.m_full)
    {}
};

} // namespace iterators
        >,
        Base
    >
{
    friend class Pothos::iterator_core_access;
    typedef filter_iterator<
        remove_whitespace_predicate<
            POTHOS_DEDUCED_TYPENAME Pothos::iterator_value<Base>::type
            //BOOST_DEDUCED_TYPENAME Base::value_type
        >,
        Base
    > super_t;
public:
//    remove_whitespace(){} // why is this needed?
    // make composible buy using templated constructor
    template<class T>
    remove_whitespace(POTHOS_PFTO_WRAPPER(T) start) :
        super_t(Base(POTHOS_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
    {}
    // intel 7.1 doesn't like default copy constructor
    remove_whitespace(const remove_whitespace & rhs) : 
        super_t(rhs.base_reference())
    {}
};

} // namespace iterators
} // namespace archive
} // namespace boost

#endif // BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP