S
scottys0
Hi everyboy,
I'm working in an IOC-IBM (IBM open class) replamecent library. the
code seens confused but , no, isn't.
#define INumber long
class IString : public std::string {
private:
... // some control variables
public
... // constructors & destructor
... // some methods
virtual INumber ocurrencesOF( IString );
}
INumber IString:currencesOf( IString _lcValue ) {
std::string::size_type _offset = this->find_first_of(
_lcValue.c_str());
while ( _offset != std::string::npos ) {
_carry++;
_offset = this->find_first_of( _lcValue.c_str(), _offset);
std::cout << "Offset : " << _offset << std::endl;
}
return _carry;
}
I've anomalous behavior from std::string class when I'm using the
find_first_of.
my question: is this a correct implementation ?, 'cause this compiles,
but I got an infinite loop.
B&R
Meyer
I'm working in an IOC-IBM (IBM open class) replamecent library. the
code seens confused but , no, isn't.
#define INumber long
class IString : public std::string {
private:
... // some control variables
public
... // constructors & destructor
... // some methods
virtual INumber ocurrencesOF( IString );
}
INumber IString:currencesOf( IString _lcValue ) {
std::string::size_type _offset = this->find_first_of(
_lcValue.c_str());
while ( _offset != std::string::npos ) {
_carry++;
_offset = this->find_first_of( _lcValue.c_str(), _offset);
std::cout << "Offset : " << _offset << std::endl;
}
return _carry;
}
I've anomalous behavior from std::string class when I'm using the
find_first_of.
my question: is this a correct implementation ?, 'cause this compiles,
but I got an infinite loop.
B&R
Meyer