|
Boost : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-05-21 14:23:59
Rob Stewart wrote:
>From: "Reece Dunn" <msclrhd_at_[hidden]>
> > Nothing. You do indeed need two functions:
> > iterator iter_offset( difference_type );
> > const_iterator const_iter_offset( difference_type ) const;
>
>Why? This is perfectly valid C++:
>
> iterator iter_offset(different_type);
> const_iterator iter_offset(different_type) const;
>
>So is there something in how you want to use them that precludes
>your overloading them that way?
No. I was not aware that it is possible to do this. I have now adopted
struct char_string
{
...
virtual iterator iter_offset(different_type) = 0;
virtual const_iterator iter_offset(different_type) const = 0;
};
into my implementation.
Q: Since the above is valid C++, is the following?:
virtual void myfn( char ) = 0;
virtual void myfn( int, bool ) = 0;
Because I had assumed that you could not do this, since (1) I haven't read
the standard that properly, I have mainly focused on learning from other
books (like Stroustrup, 3ed) and (2) I haven't seen any code that uses
virtual functions like char_string above or my question.
Regards,
Reece
_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk