mercredi 4 juillet 2018

String deconstructor throws runtime exception

Only recently has this problem been occurring. I've tried cleaning and rebuilding the solution with no luck. I've traced the exception to these function calls:

std::string::clear() {
     _Eos(0);
}

which invokes

void _Eos(const size_type _Newsize) {   
    // set new length and null terminator
    auto& _My_data = this->_Get_data();
    _Traits::assign(_My_data._Myptr()[_My_data._Mysize = _Newsize], _Elem());
}

And raises the exception here:

static _CHAR_TRAITS_CONSTEXPR void assign(char& _Left, const char& _Right) _NOEXCEPT
    {   // assign an element
    _Left = _Right;
    }

Acess violation _Right is 0 '\0'

I'm using Microsoft VS Community 2017

Aucun commentaire:

Enregistrer un commentaire