Boost logo

Boost :

From: Shunsuke Sogame (mb2act_at_[hidden])
Date: 2006-10-13 21:02:30


Hi,

If a pointer container holds noncopyable objects,
the iterators seem not to meet ReadableIteratorConcept
whose 'value_type' must be CopyConstructible?
This doesn't compile:

    #include <boost/ptr_container/ptr_vector.hpp>
    #include <boost/concept_check.hpp>
    #include <boost/iterator/iterator_concepts.hpp>
    #include <boost/noncopyable.hpp>

    struct my :
        boost::noncopyable
    { };

    template< class Iterator >
    void foo(Iterator)
    {
        boost::function_requires<
boost_concepts::ReadableIteratorConcept<Iterator> >();
    }

    int main()
    {
        boost::ptr_vector<my> vec;
        ::foo(vec.begin());
    }

Anything wrong..?

-- 
Shunsuke Sogame

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk