T
T.A.
I understand why it is not safe to inherit from STL containers, but I have
found (in SGI STL documentation) that for example bidirectional_iterator
class can be used to create your own iterator classes by inheriting from
it, ie.
class my_bidirectional_iterator : public bidirectional_iterator<double>
{
...
};
I'm trying to implement STL compatible iterators for my custom class but I
need to change type returned by dereferencing my iterators, and inheriting
from bidirectional_iterator would make my job much easier of course. Now,
what I'm wondering, do I need to use SGI STL to do that safely, or it is
standard behavior for STL?
I have found few tutorials about creating custom iterators and I think I
understand how to do it, but before I start, I want to know is it worth
(safe) to do it and there is nothing in tutorials that explains that...
T.A.
found (in SGI STL documentation) that for example bidirectional_iterator
class can be used to create your own iterator classes by inheriting from
it, ie.
class my_bidirectional_iterator : public bidirectional_iterator<double>
{
...
};
I'm trying to implement STL compatible iterators for my custom class but I
need to change type returned by dereferencing my iterators, and inheriting
from bidirectional_iterator would make my job much easier of course. Now,
what I'm wondering, do I need to use SGI STL to do that safely, or it is
standard behavior for STL?
I have found few tutorials about creating custom iterators and I think I
understand how to do it, but before I start, I want to know is it worth
(safe) to do it and there is nothing in tutorials that explains that...
T.A.