Boost logo

Boost :

From: DY, JERRY U \(SBCSI\) (jd2419_at_[hidden])
Date: 2004-07-27 14:53:48

As you suggested, an auxiliary function template is defined (outside of
the iterator_adaptor class - aC++ doesn't like it if it's a member

// workaround for aC++ CR JAGaf33512
template <typename TR1, typename TR2>
  inline void iterator_adaptor_assert_traversal () {
    typedef int

Then the old static assertion is replaced like so:

// typedef iterator_adaptor_assert_traversal<my_traversal, cat>

I tested this by adapting an ordinary pointer to a forward traversal
iterator and if the program calls the operator+= (calling the adaptor's
advance member function and triggering the static assertion), the
compile fails, the compile succeeds otherwise. There should be no
additional overhead incurred due to the workaround because the function
itself is inlined and all it does is a typedef.

Is this workaround acceptable for check-in? Thanks!


-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of David Abrahams
Sent: Saturday, July 24, 2004 8:20 AM
To: boost_at_[hidden]
Subject: [boost] Re: counting_iterator_test.hpp fails on aC++

Probably the right way to fix this is to indirect through an
auxilliary function template that does the assertion. I presume
_that_ wouldn't be instantiated unless it was actually called.

Boost list run by bdawes at, gregod at, cpdaniel at, john at