Attempting My String Class
Ok I have the suggestion that Zaei and Cornedbee gave me to use an inherted template, and I have added one of my functions to it to test it out. This is what I have so far:
Code:
template<typename C, typename T = std::char_traits<C>, typename A = std::allocator<C> >
class TECHSTRING_CL : public std::basic_string<C, T, A>
{
public:
bool IsNumeric()
{
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
const string _DIGITS_C = "1234567890."; //Const String To Hold The Values Wanted
int _iRet = 0; //Temp Return VAR
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
if(this->length() <= 0) //If A Bad Or Empty String Is Passed
return false; //Return False
_iRet = this->find_first_not_of(_DIGITS_C); //Make Sure Everything Is There
return (_iRet == -1); //If The String Is Numeric _iRet = -1
};
};
typedef TECHSTRING_CL<char> TechString;
TechString s;
But when I do the following:
s = "123456";
I get:
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const char [7]' (or there is no acceptable conversion)
So whats up?