Skip to content

Using forbidden functions? #6

@migmanu

Description

@migmanu

Hey! I was checking your answers and noticed that you are using stoi, stof and stood in module 06. As explained here, those are C++11 functions.

Did you get an exception from your School or is there a loophole in the rules?

bool    Converter::isImpossible( void ) {
    try
    {
        if ( _type == INT ) {
            _n = std::stoi( _str );
        } else if ( _type == FLOAT ) {
            _f = std::stof( _str );
        } else if ( _type == DOUBLE ) {
            _d = std::stod( _str );
        }
    }
    catch ( std::exception& e )
    {
        _impossible = true;
        return true;
    }
    return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions