Ticket #3815: clear.patch

File clear.patch, 834 bytes (added by Daniel James, 13 years ago)
  • boost/spirit/home/support/attributes.hpp

    diff --git a/boost/spirit/home/support/attributes.hpp b/boost/spirit/home/support/attributes.hpp
    index f2c12df..53a969b 100644
    a b  
    3232#include <boost/mpl/find_if.hpp>
    3333#include <boost/mpl/identity.hpp>
    3434#include <boost/variant.hpp>
     35#include <boost/range/iterator_range.hpp>
    3536#include <vector>
    3637#include <utility>
    3738
    namespace boost { namespace spirit { namespace traits  
    741742        }
    742743    };
    743744
     745    // iterator range
     746    template <typename T>
     747    struct clear_value<iterator_range<T> >
     748    {
     749        static void call(iterator_range<T>& val)
     750        {
     751            val = iterator_range<T>(val.end(), val.end());
     752        }
     753    };
     754
    744755    // main dispatch
    745756    template <typename T>
    746757    void clear(T& val)