I'm trying to create a new templated class "CrazyBucket< T >" which has to hold multiple values of type T.
I want to create a constructor for this class that can accept any 2 forward iterators as its arguments and copy in those values (of type T) to the class instance.
Constructor:
CrazyBucket< T >::CrazyBucket( iterator< forward_iterator_tag, T > start, iterator< forward_iterator_tag, T > end )
{ ... }
But when I try to call it with,
vector< int > vec;
vec.push_back( 4 );
CrazyBucket< int > bucket( vec.begin(), vec.end() );
I get the following error,
candidate constructor not viable: no known conversion from 'iterator' (aka '__wrap_iter<pointer>') to 'std::iterator<std::forward_iterator_tag, int>' for 1st argument
Any help with how I should define my constructor is much appreciated.
Thanks in advance.
< T >.